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.

228 lines
8.8 KiB

3 years ago
2 years ago
4 months ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
3 years ago
2 years ago
3 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
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 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
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
1 year ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 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
2 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
2 years ago
3 years ago
2 years ago
3 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
  1. <template>
  2. <div style="display: flex;">
  3. <div :style="'width:' + (window.pageWidth - 200 - 110 - 25) + 'px;'">
  4. <el-table :data="customerOrg.customerOrgRegisterList" border
  5. :height="window.pageHeight < 600 ? 155 : window.pageHeight - 445" size="small" highlight-current-row
  6. @row-click="rowClick" ref="customerOrg.customerOrgRegisterList">
  7. <el-table-column prop="id" label="编号" width="300" align="center" />
  8. <el-table-column prop="isQuestion" width="70" align="center">
  9. <template slot="header" slot-scope="scope">
  10. <el-tooltip content="控制体检单位【必须填写问卷调查,方可进行健康评估】" placement="top-start"><div>问卷调查</div></el-tooltip>
  11. </template>
  12. <template slot-scope="scope">
  13. <el-checkbox v-model="scope.row.isQuestion" true-label="Y" false-label="N" @change="clickQuestion(scope.row)"/>
  14. </template>
  15. </el-table-column>
  16. <el-table-column prop="medicalTimes" label="体检次数" width="70" align="center" />
  17. <el-table-column prop="beginTime" label="开始日期" min-width="80" align="center">
  18. <template slot-scope="scope">
  19. {{ scope.row.beginTime.substring(0,10) }}
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="endTime" label="结束日期" min-width="80" align="center">
  23. <template slot-scope="scope">
  24. {{ scope.row.endTime.substring(0,10) }}
  25. </template>
  26. </el-table-column>
  27. <el-table-column prop="isComplete" label="完成标志" width="70" align="center">
  28. <template slot-scope="scope">
  29. <div>{{ scope.row.isComplete === "Y" ? "是" : "否" }}</div>
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="creatorName" label="创建者" min-width="70" align="center" />
  33. <el-table-column prop="creationTime" label="创建时间" min-width="120" align="center">
  34. <template slot-scope="scope">
  35. <div v-if="scope.row.creationTime">
  36. {{ moment(scope.row.creationTime).format('yyyy-MM-DD HH:mm:ss') }}
  37. </div>
  38. </template>
  39. </el-table-column>
  40. <el-table-column prop="lastModifierName" label="修改者" min-width="70" align="center" />
  41. <el-table-column prop="lastModificationTime" label="修改时间" min-width="120" align="center">
  42. <template slot-scope="scope">
  43. <div v-if="scope.row.lastModificationTime">
  44. {{ moment(scope.row.lastModificationTime).format('yyyy-MM-DD HH:mm:ss') }}
  45. </div>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. </div>
  50. <div style="margin-left: 10px; margin-top: 20px">
  51. <div v-show="checkPagePriv(pagePriv.privs, '新增次数')" style="margin-top: 10px">
  52. <el-button type="primary" @click="add" class="commonbutton">新增次数</el-button>
  53. </div>
  54. <div v-show="checkPagePriv(pagePriv.privs, '体检完成')" style="margin-top: 10px">
  55. <el-button type="success" @click="edit" class="commonbutton">体检完成</el-button>
  56. </div>
  57. <div v-show="checkPagePriv(pagePriv.privs, '取消完成')" style="margin-top: 10px">
  58. <el-button type="warning" @click="cansel" class="commonbutton">取消完成</el-button>
  59. </div>
  60. <div v-show="checkPagePriv(pagePriv.privs, '删除次数')" style="margin-top: 10px">
  61. <el-button type="danger" @click="btnDel" class="deleteButton">删除次数</el-button>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import moment from "moment";
  68. import { mapState, mapMutations } from "vuex";
  69. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  70. import { getPagePriv, checkPagePriv, tcdate, objCopy, deepCopy, arrayExistObj } from "../../utlis/proFunc";
  71. export default {
  72. components: {},
  73. data() {
  74. return {
  75. pagePriv: {
  76. routeUrlorPageName: 'customerOrg', //当前页面归属路由或归属页面权限名称
  77. privs: [] // 页面权限
  78. },
  79. customerOrgRegisterId: "", //体检次数ID
  80. };
  81. },
  82. created() {
  83. //获取用户当前页面的权限
  84. let userPriv = window.sessionStorage.getItem('userPriv')
  85. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  86. },
  87. //挂载完成
  88. mounted() {
  89. this.getCustomerOrgRegisterList(this.dataTransOpts.tableS.customer_org_register.pid);
  90. },
  91. computed: {
  92. ...mapState(["customerOrg", "window", "dataTransOpts"]),
  93. },
  94. methods: {
  95. moment, checkPagePriv,
  96. //点击体检次数行
  97. rowClick(row) {
  98. this.customerOrgRegisterId = row.id;
  99. },
  100. //获取体检次数列表
  101. getCustomerOrgRegisterList(customerOrgPid) {
  102. if (customerOrgPid) {
  103. getapi(
  104. `/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${customerOrgPid}`
  105. ).then((res) => {
  106. if (res.code != -1) {
  107. this.customerOrg.customerOrgRegisterList = res.data;
  108. }
  109. });
  110. } else {
  111. this.customerOrg.customerOrgRegisterList = []
  112. }
  113. },
  114. // 某些体检单位,需控制【必须填写问卷调查方查进行健康评估】
  115. clickQuestion(row){
  116. //console.log('row',row)
  117. postapi('/api/app/CustomerOrgRegister/UpdateIsQuestion',{
  118. customerOrgRegisterId: row.id,
  119. isQuestion: row.isQuestion
  120. }).then(res => {
  121. if(res.code > -1) this.$message.success({ showClose: true, message: "操作成功!"})
  122. })
  123. },
  124. //设置体检次数状态
  125. setOrgRegisterState(IsComplete) {
  126. if (!this.dataTransOpts.tableS.customer_org.id || !this.customerOrgRegisterId) {
  127. console.log(this.dataTransOpts.tableS.customer_org.id , this.customerOrgRegisterId);
  128. this.$message.warning({ showClose: true, message: "请选中要操作的体检次数"});
  129. return;
  130. }
  131. //console.log(`/api/app/customer-org-register/${this.customerOrgRegisterId}/state`)
  132. putapi(
  133. `/api/app/customer-org-register/${this.customerOrgRegisterId}/state?IsComplete=${IsComplete}`
  134. ).then((res) => {
  135. console.log("设置体检次数状态", res.data);
  136. this.getCustomerOrgRegisterList(this.dataTransOpts.tableS.customer_org.id );
  137. console.log("操作成功!");
  138. });
  139. },
  140. //体检次数 相关操作
  141. async add() {
  142. //console.log("增加次数 addTimes");
  143. if (!this.dataTransOpts.tableS.customer_org.id ) {
  144. this.$message.warning({ showClose: true, message: "单位信息未保存!"});
  145. return;
  146. }
  147. try {
  148. let result = await getapi(`/api/app/customer-org/parent/${this.dataTransOpts.tableS.customer_org.id }`)
  149. postapi(`/api/customerorgregister/createcustomerorgregister?CustomerOrgId=${result.data}`).then((res) => {
  150. if (res.code != -1) {
  151. this.getCustomerOrgRegisterList(result.data);
  152. console.log("操作成功!");
  153. }
  154. })
  155. } catch (error) {
  156. this.$message.error({ showClose: true, message: "操作失败!" + err});
  157. }
  158. },
  159. edit() {
  160. //console.log("体检完成 editCustomerOrgRegister");
  161. this.setOrgRegisterState("Y");
  162. },
  163. cansel() {
  164. //console.log("体检完成 editCustomerOrgRegister");
  165. this.setOrgRegisterState("N");
  166. },
  167. btnDel() {
  168. if (!this.dataTransOpts.tableS.customer_org.id || !this.customerOrgRegisterId) {
  169. //console.log(this.dataTransOpts.tableS.customer_org.id , this.customerOrgRegisterId);
  170. this.$message.warning({ showClose: true, message: '请选中要操作的体检次数'})
  171. return;
  172. }
  173. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  174. confirmButtonText: "是",
  175. cancelButtonText: "否",
  176. type: "warning",
  177. }).then(() => {
  178. //console.log('{patientRegisterIds}',{patientRegisterIds})
  179. return deletapi(`/api/app/customer-org-register/${this.customerOrgRegisterId}`);
  180. }).then((res) => {
  181. if (res.code != -1) {
  182. console.log("删除 操作成功");
  183. let lfind = arrayExistObj(this.customerOrg.customerOrgRegisterList, 'id', this.customerOrgRegisterId)
  184. if (lfind > - 1) this.customerOrg.customerOrgRegisterList.splice(lfind, 1)
  185. this.customerOrgRegisterId = ''
  186. }
  187. }).catch((err) => {
  188. //
  189. });
  190. }
  191. },
  192. //监听事件
  193. watch: {
  194. // 体检次数父ID未切换换时 也可以强制刷新数据
  195. "dataTransOpts.refresh.customer_org_register.M": {
  196. // immediate: true,
  197. handler(newVal, oldVal) {
  198. console.log(`watch 体检次数 newVal:${newVal} oldVal:${oldVal} customerOrgPid: ${this.dataTransOpts.tableS.customer_org.parent_id}`);
  199. this.getCustomerOrgRegisterList(this.dataTransOpts.tableS.customer_org.parent_id);
  200. }
  201. },
  202. },
  203. };
  204. </script>
  205. <style scoped>
  206. .box {
  207. display: flex;
  208. }
  209. .btnClass {
  210. width: 110px;
  211. }
  212. </style>