EditModal.vue 4.9 KB

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