clusteringDetail.vue 7.5 KB

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