clusteringDetail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <!--新增、编辑、查看集群信息-->
  2. <template>
  3. <div>
  4. <el-form
  5. ref="form"
  6. :model="form"
  7. :rules="rules"
  8. label-width="200px"
  9. class="flexBox"
  10. >
  11. <div class="formItemBox">
  12. <el-form-item label="账户名称:" prop="userName">
  13. <el-input
  14. placeholder="请输入"
  15. readOnly
  16. v-autoTrim="{ obj: form, key: 'userName' }"
  17. v-model="form.userName"
  18. >
  19. </el-input>
  20. </el-form-item>
  21. <el-form-item label="独占类型:" prop="userType">
  22. <el-select v-model="form.userType" readOnly>
  23. <el-option
  24. v-for="item in userTypeList"
  25. :label="item.caption"
  26. :value="item.code"
  27. :key="item.code"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="仿真软件license数量:" prop="numSimulationLicense">
  32. <el-input
  33. placeholder="请输入"
  34. maxlength="20"
  35. v-autoTrim="{ obj: form, key: 'numSimulationLicense' }"
  36. v-model="form.numSimulationLicense"
  37. >
  38. </el-input>
  39. </el-form-item>
  40. <el-form-item label="到期时间:" prop="dateSimulationLicense">
  41. <el-date-picker
  42. v-model="form.dateSimulationLicense"
  43. type="date"
  44. placeholder="选择日期"
  45. value-format="yyyy-MM-dd"
  46. ></el-date-picker>
  47. </el-form-item>
  48. <el-form-item label="动力学软件license数量:" prop="numDynamicLicense">
  49. <el-input
  50. placeholder="请输入"
  51. maxlength="20"
  52. v-autoTrim="{ obj: form, key: 'numDynamicLicense' }"
  53. v-model="form.numDynamicLicense"
  54. >
  55. </el-input>
  56. </el-form-item>
  57. <el-form-item label="到期时间:" prop="dateDynamicLicense">
  58. <el-date-picker
  59. v-model="form.dateDynamicLicense"
  60. type="date"
  61. placeholder="选择日期"
  62. value-format="yyyy-MM-dd"
  63. ></el-date-picker>
  64. </el-form-item>
  65. </div>
  66. </el-form>
  67. <div class="title">历史记录</div>
  68. <tableList
  69. ref="table"
  70. style="width:60%;min-width: 900px;margin: auto;"
  71. :columns="columns"
  72. :getDataWay="getDataWay"
  73. index
  74. >
  75. </tableList>
  76. <div class="btns">
  77. <el-button type="primary" @click="save">保存</el-button>
  78. <el-button type="primary" plain @click="cancel">取消</el-button>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. import tableList from "@/components/grid/TableList";
  84. export default {
  85. name: "clusteringDetail",
  86. components: {tableList},
  87. data() {
  88. return {
  89. userTypeList: [],
  90. getDataWay:{
  91. dataType: "url",
  92. type: "post",
  93. firstRequest: false,
  94. data: this.$api.systemManagement.getClusterHistory,
  95. param: {
  96. //userId: this.$route.query.userId
  97. },
  98. },
  99. columns: [
  100. //表格列
  101. {
  102. label: "仿真软件license",
  103. prop: "numSimulationLicense",
  104. },
  105. {
  106. label: "到期时间",
  107. prop: "dateSimulationLicense",
  108. },
  109. {
  110. label: "动力学软件license",
  111. prop: "numDynamicLicnese",
  112. },
  113. {
  114. label: "到期时间",
  115. prop: "dateDynamicLicense",
  116. },
  117. {
  118. label: "操作时间",
  119. prop: "modifyTime"
  120. }
  121. ],
  122. form: {
  123. userName:"",
  124. id: "",
  125. userId: "",
  126. numSimulationLicense: "",
  127. dateSimulationLicense: "",
  128. numDynamicLicense: "",
  129. dateDynamicLicense: ""
  130. },
  131. rules: {
  132. numSimulationLicense: [{ required: true, message: "请输入", trigger: "blur" }],
  133. dateSimulationLicense: [{ required: true, message: "请选择", trigger: "blur" }],
  134. numDynamicLicense: [{ required: true, message: "请输入", trigger: "blur" }],
  135. dateDynamicLicense: [{ required: true, message: "请选择", trigger: "blur" }]
  136. }
  137. };
  138. },
  139. created(){
  140. if(this.$route.query.userId){
  141. this.form = {...this.$route.query}
  142. this.getDataWay.param = {
  143. userId: this.$route.query.userId
  144. }
  145. this.$refs.table.loadData()
  146. }
  147. },
  148. async mounted() {
  149. await this.$dicsListsInit({
  150. userTypeList: "useType"
  151. });
  152. },
  153. computed: {},
  154. methods: {
  155. save(){
  156. this.$axios({
  157. method:"POST",
  158. url:this.$api.systemManagement.saveCluster,
  159. data:{
  160. ...this.form
  161. }
  162. }).then(res=>{
  163. if(res.code == 200){
  164. this.$message.success("保存成功");
  165. this.$router.history.go(-1)
  166. }else{
  167. this.$message.error(res.message || "保存失败");
  168. }
  169. })
  170. },
  171. cancel(){
  172. this.$router.history.go(-1)
  173. },
  174. },
  175. };
  176. </script>
  177. <style lang="less" scoped>
  178. .el-form {
  179. width: 60%;
  180. min-width: 900px;
  181. padding-top: 60px;
  182. margin: 0 auto;
  183. .formItemBox {
  184. flex: 1;
  185. /deep/ .el-input,
  186. .el-select {
  187. width: 100%;
  188. }
  189. }
  190. .el-textarea {
  191. height: 96px;
  192. }
  193. }
  194. .btns {
  195. padding-top: 30px;
  196. text-align: center;
  197. }
  198. .title {
  199. width: 60%;
  200. min-width: 900px;
  201. margin: 4px auto;
  202. border-left: 6px solid @themeColor;
  203. padding-left: 20px;
  204. color: @themeColor;
  205. font-size: 16px;
  206. font-weight: bold;
  207. }
  208. </style>