EditModal.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div class="delete_modal">
  3. <div class="modal_content">
  4. <p class="edit">编辑</p>
  5. <div class="content">
  6. <div class="dlr">
  7. <p style="width: 100px">DLR Code</p>
  8. <p>{{ dataObj.dlrCode }}</p>
  9. </div>
  10. <div class="area">
  11. <p style="width: 100px">所属区域</p>
  12. <p>{{ dataObj.localArea }}</p>
  13. </div>
  14. <div class="distributor">
  15. <p style="width: 100px">经销商店名</p>
  16. <p>{{ dataObj.dlrName }}</p>
  17. </div>
  18. <div class="plate">
  19. <p style="width: 100px">所属平台</p>
  20. <p>{{ dataObj.platformName}}</p>
  21. </div>
  22. <div class="account">
  23. <p style="width: 100px">平台账号</p>
  24. <input v-model="accountCode" @blur="checkVal()"/>
  25. </div>
  26. <div v-show="accountIsNumber" style="color: red;font-size: 12px;text-align:center;width: 66%;">平台账号不能为纯数字</div>
  27. <div class="isAttest">
  28. <p style="width: 100px">是否认证</p>
  29. <select v-model="selectValue">
  30. <!-- 原来列表展示什么,select默认展示 -->
  31. <option>{{ authorizationName === '是' ? "是" : "否" }}</option>
  32. <option>{{ authorizationName === '是' ? "否" : "是" }}</option>
  33. </select>
  34. </div>
  35. <div class="fans">
  36. <p style="width: 100px">粉丝数</p>
  37. <!-- <input v-model="fansNums" type="number"/> -->
  38. <p>{{fansNums}}</p>
  39. </div>
  40. </div>
  41. <div class="btn">
  42. <div class="current_button" @click="submit" style="margin: 0">确定</div>
  43. <div class="current_button" style="margin: 0" @click="hideModal">
  44. 取消
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. props: {
  53. dataObj: {
  54. type: Object,
  55. default: () => {
  56. return {};
  57. },
  58. },
  59. modalAccount: {
  60. type: String,
  61. default: ''
  62. },
  63. authorizationName: {
  64. type: String,
  65. default: ''
  66. },
  67. modalFanCount: {
  68. type: Number,
  69. default: 0
  70. },
  71. },
  72. data() {
  73. return {
  74. accountCode: this.modalAccount,
  75. fansNums: this.modalFanCount,
  76. selectValue: this.authorizationName,
  77. accountIsNumber:false
  78. };
  79. },
  80. methods: {
  81. checkVal(){
  82. if(this.dataObj.platformName === '今日头条'){
  83. this.accountIsNumber = /^\d+$/.test(this.accountCode);
  84. }else {
  85. return true
  86. }
  87. },
  88. submit: function () {
  89. let isAttesta = this.selectValue;
  90. // let fansNum = this.fansNums;
  91. let accountCode = this.accountCode;
  92. // console.log(isAttesta, fansNum, accountCode);
  93. if (!accountCode) {
  94. alert('平台账号不能为空');
  95. return
  96. }
  97. if (this.accountIsNumber) {
  98. alert('平台账号不能为纯数字');
  99. return
  100. }
  101. // if (fansNum < 0) {
  102. // alert('粉丝数必须大于等于0!');
  103. // return
  104. // }
  105. this.$emit("edit_data", isAttesta, accountCode);
  106. },
  107. hideModal: function () {
  108. this.$emit("hide_modal");
  109. },
  110. },
  111. mounted() {
  112. },
  113. };
  114. </script>
  115. <style scoped lang="less">
  116. .delete_modal {
  117. position: fixed;
  118. left: 0;
  119. top: 0;
  120. height: 100vh;
  121. width: 100vw;
  122. background-color: rgba(127, 127, 127, 0.7);
  123. display: flex;
  124. justify-content: center;
  125. align-items: center;
  126. text-align: left;
  127. .modal_content {
  128. width: 700px;
  129. height: 500px;
  130. background-color: #eee;
  131. transform: translateY(-50px);
  132. .edit {
  133. height: 40px;
  134. line-height: 40px;
  135. font-size: 20px;
  136. text-align: left;
  137. border-bottom: 1px solid #ccc;
  138. padding-left: 20px;
  139. }
  140. .content {
  141. padding-left: 220px;
  142. .dlr {
  143. display: flex;
  144. margin-top: 20px;
  145. p {
  146. font-size: 14px;
  147. height: 28px;
  148. line-height: 28px;
  149. }
  150. }
  151. .area {
  152. display: flex;
  153. margin-top: 15px;
  154. p {
  155. font-size: 14px;
  156. height: 28px;
  157. line-height: 28px;
  158. }
  159. }
  160. .distributor {
  161. margin-top: 15px;
  162. display: flex;
  163. height: 28px;
  164. line-height: 28px;
  165. p {
  166. font-size: 14px;
  167. }
  168. }
  169. .plate {
  170. margin-top: 15px;
  171. display: flex;
  172. height: 28px;
  173. line-height: 28px;
  174. p {
  175. font-size: 14px;
  176. }
  177. }
  178. .account {
  179. margin-top: 15px;
  180. display: flex;
  181. height: 28px;
  182. line-height: 28px;
  183. p {
  184. font-size: 14px;
  185. }
  186. }
  187. .isAttest {
  188. margin-top: 15px;
  189. display: flex;
  190. p {
  191. font-size: 14px;
  192. height: 28px;
  193. line-height: 28px;
  194. }
  195. select {
  196. border: 1px solid #ccc;
  197. width: 144px;
  198. height: 28px;
  199. font-size: 14px;
  200. option {
  201. color: #555;
  202. font-size: 14px;
  203. }
  204. }
  205. }
  206. .fans {
  207. margin-top: 15px;
  208. display: flex;
  209. height: 28px;
  210. line-height: 28px;
  211. p {
  212. font-size: 14px;
  213. }
  214. input {
  215. border: 1px solid #ccc;
  216. width: 144px;
  217. height: 28px;
  218. font-size: 14px;
  219. }
  220. }
  221. }
  222. .btn {
  223. margin: 0 auto;
  224. width: 150px;
  225. margin-top: 50px;
  226. display: flex;
  227. justify-content: space-between;
  228. }
  229. }
  230. }
  231. </style>