condition.php 8.0 KB

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