You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="'width:' + (window.pageWidth - 200 - 120 - 90) + 'px;'">
  4. <el-table :data="customerOrg.customerOrgRegisterList" border :height="window.pageHeight < 600 ? 108:window.pageHeight - 492" size="small"
  5. highlight-current-row @row-click="rowClick" ref="customerOrg.customerOrgRegisterList">
  6. <el-table-column prop="medicalTimes" label="体检次数" />
  7. <el-table-column prop="beginTime" label="开始日期">
  8. <template slot-scope="scope">
  9. {{ moment(scope.row.beginTime).format('yyyy-MM-DD') }}
  10. </template>
  11. </el-table-column>
  12. <el-table-column prop="endTime" label="结束日期">
  13. <template slot-scope="scope">
  14. {{ moment(scope.row.endTime).format('yyyy-MM-DD') }}
  15. </template>
  16. </el-table-column>
  17. <el-table-column prop="isComplete" label="完成标志">
  18. <template slot-scope="scope">
  19. <div>{{ scope.row.isComplete === "Y" ? "是" : "否" }}</div>
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="creatorName" label="创建者" width="" />
  23. <el-table-column prop="creationTime" label="创建时间" width="200">
  24. <template slot-scope="scope">
  25. <div v-if="scope.row.creationTime">
  26. {{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
  27. </div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column prop="lastModifierName" label="修改者" />
  31. <el-table-column prop="lastModificationTime" label="修改时间" width="200">
  32. <template slot-scope="scope">
  33. <div v-if="scope.row.lastModificationTime">
  34. {{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
  35. </div>
  36. </template>
  37. </el-table-column>
  38. </el-table>
  39. </div>
  40. <div style="margin-left: 10px; margin-top: 40px">
  41. <div style="margin-top: 10px">
  42. <el-button type="primary" @click="add" class="btnClass">增加次数</el-button>
  43. </div>
  44. <div style="margin-top: 10px">
  45. <el-button type="success" @click="edit" class="btnClass">体检完成</el-button>
  46. </div>
  47. <div style="margin-top: 10px">
  48. <el-button type="danger" @click="cansel" class="btnClass">取消完成</el-button>
  49. </div>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import moment from "moment";
  55. import { mapState, mapMutations } from "vuex";
  56. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  57. export default {
  58. components: {},
  59. data() {
  60. return {
  61. customerOrgRegisterId: "", //体检次数ID
  62. };
  63. },
  64. created() { },
  65. //挂载完成
  66. mounted() { },
  67. computed: {
  68. ...mapState(["customerOrg", "window"]),
  69. },
  70. methods: {
  71. moment,
  72. //点击体检次数行
  73. rowClick(row) {
  74. this.customerOrgRegisterId = row.id;
  75. },
  76. //获取体检次数列表
  77. getCustomerOrgRegisterList(customerOrgId) {
  78. getapi(
  79. `/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgId}`
  80. ).then((res) => {
  81. //console.log('res.data',res.data)
  82. this.customerOrg.customerOrgRegisterList = res.data;
  83. });
  84. this.customerOrgRegisterId = "";
  85. },
  86. //设置体检次数状态
  87. setOrgRegisterState(IsComplete) {
  88. if (!this.customerOrg.customerOrgId || !this.customerOrgRegisterId) {
  89. console.log(this.customerOrg.customerOrgId, this.customerOrgRegisterId);
  90. alert("请选中要操作的体检次数");
  91. return;
  92. }
  93. //console.log(`/api/app/customer-org-register/${this.customerOrgRegisterId}/state`)
  94. putapi(
  95. `/api/app/customer-org-register/${this.customerOrgRegisterId}/state?IsComplete=${IsComplete}`
  96. ).then((res) => {
  97. console.log("设置体检次数状态", res.data);
  98. this.getCustomerOrgRegisterList(this.customerOrg.customerOrgId);
  99. this.$message.success("操作成功!");
  100. });
  101. },
  102. //体检次数 相关操作
  103. add() {
  104. //this.$message.success("增加次数 addTimes");
  105. let customerOrgId = this.customerOrg.customerOrgRegisterList[0].customerOrgId
  106. if (!customerOrgId) {
  107. alert("单位信息未保存!");
  108. return;
  109. }
  110. postapi(
  111. `/api/customerorgregister/createcustomerorgregister?CustomerOrgId=${customerOrgId}`
  112. ).then((res) => {
  113. if (res.Code != -1) {
  114. this.getCustomerOrgRegisterList(customerOrgId);
  115. this.$message.success("操作成功!");
  116. }
  117. });
  118. },
  119. edit() {
  120. //this.$message.success("体检完成 editCustomerOrgRegister");
  121. this.setOrgRegisterState("Y");
  122. },
  123. cansel() {
  124. //this.$message.success("体检完成 editCustomerOrgRegister");
  125. this.setOrgRegisterState("N");
  126. },
  127. },
  128. };
  129. </script>
  130. <style scoped>
  131. .box {
  132. display: flex;
  133. }
  134. .btnClass {
  135. width: 110px;
  136. }
  137. </style>