condition.php 8.1 KB

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