condition.php 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div>
  5. <span>设置升级条件</span>
  6. </div>
  7. </div>
  8. <div class="table-body">
  9. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" @close="handleClose('ruleForm')">
  10. <el-form-item label="升级条件" :label-width="formLabelWidth" prop="level">
  11. <template>
  12. <el-checkbox-group v-model="ruleForm.checked_condition_keys" class="check-group">
  13. <div style="margin-top: 20px" v-for="item in upgrade_condition">
  14. <el-checkbox :label="item.id" v-model="item.id" border size="medium">
  15. <div v-if="!item.is_html">{{item.content}}</div>
  16. <div v-else v-html="item.content" class="feature-item"></div>
  17. </el-checkbox>
  18. </div>
  19. </el-checkbox-group>
  20. </template>
  21. </el-form-item>
  22. </el-form>
  23. <div slot="footer" class="dialog-footer">
  24. <el-button type="primary" @click="postAdd('ruleForm')">确 定</el-button>
  25. </div>
  26. </div>
  27. </el-card>
  28. </div>
  29. <script>
  30. new Vue({
  31. el: '#app',
  32. data() {
  33. return {
  34. activeName: "1",
  35. tableData: [],
  36. rules: {
  37. },
  38. upgrade_condition:[],
  39. ruleForm: {
  40. checked_condition_keys:[1,2],
  41. compute_type:1,
  42. },
  43. formLabelWidth: '150px',
  44. }
  45. },
  46. created() {
  47. this.getList();
  48. },
  49. methods: {
  50. postAdd(formName) {
  51. this.$refs[formName].validate((valid) => {
  52. if (valid) {
  53. this.$request({
  54. method: "post",
  55. params: {
  56. r: 'boss-weight/level/condition',
  57. },
  58. data: this.ruleForm
  59. }).then(e => {
  60. if (e.data.code == 0) {
  61. this.$message({
  62. message: e.data.msg,
  63. type: 'success'
  64. });
  65. navigateTo({
  66. r: 'boss-weight/level/index',
  67. })
  68. }else{
  69. this.$message.error(e.data.msg);
  70. }
  71. }).catch(e => {});
  72. }
  73. });
  74. },
  75. getList(){
  76. this.$request({
  77. params: {
  78. r: 'boss-weight/level/condition',
  79. },
  80. }).then(e => {
  81. if(e.data.code==0){
  82. this.upgrade_condition = e.data.data.upgrade_condition;
  83. this.ruleForm.checked_condition_keys = e.data.data.checked_condition_keys;
  84. this.ruleForm.compute_type = e.data.data.compute_type;
  85. }else{
  86. this.$message.error(e.data.msg);
  87. }
  88. console.log(e.data.data);
  89. }).catch(e => {});
  90. },
  91. goodsSelect(){
  92. },
  93. picUrl(e) {
  94. if (e.length) {
  95. this.ruleForm.pic_url = e[0].url;
  96. this.$refs.ruleForm.validateField('pic_url');
  97. }
  98. },
  99. },
  100. });
  101. </script>
  102. <style>
  103. .table-body {
  104. padding: 20px 20px;
  105. background-color: #fff;
  106. }
  107. .table-body .top-input {
  108. margin-top: 34px;
  109. }
  110. .input-item {
  111. width: 200px;
  112. margin-right: 20px;
  113. }
  114. .input-item .el-input__inner {
  115. border-right: 0;
  116. }
  117. .input-item .el-input__inner:hover {
  118. border: 1px solid #dcdfe6;
  119. border-right: 0;
  120. outline: 0;
  121. }
  122. .input-item .el-input__inner:focus {
  123. border: 1px solid #dcdfe6;
  124. border-right: 0;
  125. outline: 0;
  126. }
  127. .input-item .el-input-group__append {
  128. background-color: #fff;
  129. border-left: 0;
  130. width: 10%;
  131. padding: 0;
  132. }
  133. .input-item .el-input-group__append .el-button {
  134. padding: 0;
  135. }
  136. .input-item .el-input-group__append .el-button {
  137. margin: 0;
  138. }
  139. /* #app .table-body .el-table .el-button {
  140. border-radius: 16px;
  141. } */
  142. .create {
  143. height: 36px;
  144. line-height: 36px;
  145. float: right;
  146. color: #BCBCBC;
  147. margin-left: 20px;
  148. }
  149. .name {
  150. cursor: pointer;
  151. color: #49A9FF;
  152. }
  153. /* 卡片 */
  154. .plugin-list {
  155. margin: 0 0 0 -20px;
  156. /* padding-right: 100px; */
  157. display: flex;
  158. flex-wrap: wrap;
  159. }
  160. .plugin-list .plugin-item {
  161. width: 20%;
  162. min-width: 400px;
  163. }
  164. .plugin-item {
  165. border: 1px solid #ebebeb;
  166. background: #FFFFFF;
  167. box-shadow: 3px 5px 15px rgba(80, 80, 80, 0.16);
  168. opacity: 1;
  169. border-radius: 5px;
  170. padding: 20px;
  171. margin: 0 0 20px 20px;
  172. transition: 250ms;
  173. position: relative;
  174. /* min-width: 300px; */
  175. }
  176. .plugin-item .item-status {
  177. position: absolute;
  178. top: 0;
  179. right: 0;
  180. width: 94px;
  181. height: 30px;
  182. background: #E8EAEC;
  183. opacity: 1;
  184. border-radius: 0px 5px 0px 5px;
  185. font-size: 14px;
  186. font-family: Microsoft YaHei;
  187. font-weight: 400;
  188. line-height: 30px;
  189. color: #9398A4;
  190. text-align: center;
  191. }
  192. .item-status-permanent {
  193. width: 94px;
  194. }
  195. .item-status-effective {
  196. width: 164px;
  197. }
  198. .plugin-item .item-info {
  199. display: flex;
  200. align-items: center;
  201. }
  202. /* .plugin-item .item-info .item-right{
  203. min-width: 500px;
  204. } */
  205. .plugin-item .item-btns {
  206. display: flex;
  207. align-items: center;
  208. justify-content: flex-end;
  209. margin-top: 12px;
  210. }
  211. .plugin-item .mall-logo {
  212. width: 70px;
  213. height: 70px;
  214. margin-right: 12px;
  215. }
  216. .plugin-item .mall-logo img {
  217. width: 100%;
  218. height: 100%;
  219. display: block;
  220. border-radius: 50%;
  221. }
  222. .plugin-item .display-name {
  223. font-size: 18pt;
  224. margin-top: 10px;
  225. margin-bottom: 4px;
  226. font-family: Microsoft YaHei;
  227. font-weight: bold;
  228. line-height: 30px;
  229. color: #3F495D;
  230. opacity: 1;
  231. width: 200px;
  232. white-space: nowrap;
  233. overflow: hidden;
  234. text-overflow: ellipsis;
  235. }
  236. .plugin-item .name {
  237. color: #909399;
  238. }
  239. .plugin-item:hover {
  240. cursor: pointer;
  241. border-color: #bfddff;
  242. }
  243. /* .plugin-item:hover .display-name {
  244. color: #409EFF;
  245. } */
  246. .plugin-item .plugin-option-btn {
  247. height: 25px;
  248. width: 25px;
  249. font-size: 12px;
  250. padding: 0;
  251. }
  252. .plugin-item .detail-option.detail-option {
  253. color: #909399;
  254. background: #F2F6FC;
  255. }
  256. .plugin-item .detail-option:hover {
  257. color: #fff;
  258. background: #909399;
  259. }
  260. .feature-item input{
  261. appearance: auto;
  262. }
  263. .feature-item .radio-inline{
  264. display: flex;
  265. align-items: center;
  266. }
  267. .feature-item{
  268. display: flex;
  269. }
  270. .feature-item input[type="radio" i]{
  271. margin-top: 0;
  272. }
  273. </style>