workpoints.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <div class="all">
  3. <div class="initialPoint">
  4. <div class="initia_title">{{initia_head.initial_suername}}</div>
  5. <div class="initia_title_1">{{initia_head.initial_suertext}}</div>
  6. <!-- <el-form :label-width="initia_head.initial_width">
  7. <el-form-item prop="base_point" style="margin: 20px 0 0 0 " v-for="(v,i) in initia_arr" :key="i">
  8. <template slot="label">
  9. <span :style="'width:'+initia_head.initial_left">{{v.initialName}}</span>
  10. <el-tooltip placement="top">
  11. <div slot="content" class="initia_mark_none_text" v-html="v.initial_text"></div>
  12. <span class="initia_mark" v-show="v.initia_mark">?</span>
  13. </el-tooltip>
  14. </template>
  15. <el-input
  16. class="nitia_list_input"
  17. v-model="v.initia_input"
  18. placeholder="请输入分值"
  19. oninput="if(this.value=='0'){this.value='';}else{this.value=this.value.replace(/[^0-9]/g,'')}"
  20. ></el-input>
  21. </el-form-item>
  22. </el-form>-->
  23. <div v-for="(v,i) in initia_arr" :key="i">
  24. <el-form
  25. :model="v.initia_input"
  26. ref="v.initia_input"
  27. :label-width="initia_head.initial_width"
  28. class="demo-ruleForm"
  29. >
  30. <el-form-item
  31. style="margin: 20px 0 0 0 "
  32. prop="age"
  33. :rules="[
  34. { required: true, message: '分值不能为空'},
  35. ]"
  36. >
  37. <template slot="label">
  38. <span :style="'width:'+initia_head.initial_left">{{v.initialName}}</span>
  39. <el-tooltip placement="top">
  40. <div slot="content" v-html="v.initial_text"></div>
  41. <span class="initia_mark" v-show="v.initia_mark">?</span>
  42. </el-tooltip>
  43. </template>
  44. <el-input
  45. type="age"
  46. v-model="v.initia_input.age"
  47. autocomplete="off"
  48. class="nitia_list_input"
  49. placeholder="请输入分值"
  50. oninput="if(this.value=='0'){this.value='';}else{this.value=this.value.replace(/[^0-9]/g,'')}"
  51. ></el-input>
  52. </el-form-item>
  53. </el-form>
  54. </div>
  55. <el-button
  56. type="primary"
  57. class="initia_button"
  58. @click="save()"
  59. :style="'margin: 20px 0 20px '+initia_head.initial_left"
  60. >保存</el-button>
  61. </div>
  62. </div>
  63. </template>
  64. <script>
  65. export default {
  66. props: {
  67. initia_arr: Array,
  68. initia_head: Object,
  69. },
  70. data() {
  71. return {};
  72. },
  73. created() {},
  74. mounted() {},
  75. methods: {
  76. save() {
  77. let arr = [];
  78. for (var i = 0; i < this.initia_arr.length; i++) {
  79. if (this.initia_arr[i].initia_input.age !== "") {
  80. arr.push({
  81. sj: this.initia_arr[i].initia_input.age,
  82. });
  83. if (arr.length == this.initia_arr.length) {
  84. this.$emit("initia", arr);
  85. this.disableds = false;
  86. }
  87. } else {
  88. this.$message({
  89. message: "请输入分值",
  90. type: "warning",
  91. });
  92. return;
  93. }
  94. }
  95. },
  96. },
  97. };
  98. </script>
  99. <style>
  100. .el-form-item__label {
  101. text-align: left;
  102. }
  103. .initialPoint {
  104. margin-left: 30px;
  105. }
  106. .initia_mark {
  107. background: #409eff;
  108. border-radius: 50%;
  109. width: 14px;
  110. height: 14px;
  111. color: #fff;
  112. display: inline-block;
  113. font-size: 12px;
  114. line-height: 14px;
  115. text-align: center;
  116. margin-left: 4px;
  117. cursor: default;
  118. }
  119. .initia_title {
  120. font-size: 20px;
  121. color: rgba(48, 49, 51, 1);
  122. padding-top: 30px;
  123. font-family: PingFangSC-Regular;
  124. }
  125. .initia_title_1 {
  126. color: #606266;
  127. font-size: 14px;
  128. margin-top: 10px;
  129. }
  130. .nitia_list_input {
  131. width: 160px;
  132. height: 40px;
  133. border-radius: 4px;
  134. background-color: rgba(255, 255, 255, 1);
  135. }
  136. </style>