Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

statisticalConfiguration.vue 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. </div>
  6. <div class="app-container statisticalConfig">
  7. <el-tabs v-model="tabActiveName" @tab-click="handleTabClick" style="margin-bottom:10px">
  8. <el-tab-pane label="质控达标统计配置" name="control"></el-tab-pane>
  9. <el-tab-pane label="检验检查统计配置" name="query"></el-tab-pane>
  10. </el-tabs>
  11. <el-row :gutter="20">
  12. <el-col :span="2" :offset="22">
  13. <el-button type="primary" class="newadd" @click="newDialog = true">新增</el-button>
  14. </el-col>
  15. </el-row>
  16. <div class="configTable">
  17. <el-table :data="configuraData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}">
  18. <el-table-column prop="date" label="检验检查大项" width="180">
  19. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  20. </el-table-column>
  21. <el-table-column prop="name" label="检查小项" width="300">
  22. <template slot-scope="scope">{{ scope.row.item_name }}</template>
  23. </el-table-column>
  24. <el-table-column prop="address" label="范围">
  25. <template slot-scope="scope">
  26. <span v-if="scope.row.range_type == 1">
  27. {{ scope.row.min_range }} - {{scope.row.large_range}}
  28. </span>
  29. <span v-if="scope.row.range_type == 2">
  30. {{scope.row.range_value}}
  31. </span>
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="address" label="单位">
  35. <template slot-scope="scope">{{ scope.row.unit }}</template>
  36. </el-table-column>
  37. <el-table-column prop="address" label="排序">
  38. <template slot-scope="scope">{{ scope.row.sort }}</template>
  39. </el-table-column>
  40. <el-table-column label="操作" width="180">
  41. <template slot-scope="scope">
  42. <el-button size="mini" type="primary" @click="handleEdit(scope.row.id)">编辑</el-button>
  43. <el-button size="mini" type="danger" @click="handleDelete(scope.row.id,scope.$index)">删除</el-button>
  44. </template>
  45. </el-table-column>
  46. </el-table>
  47. <el-pagination
  48. @size-change="handleSizeChange"
  49. @current-change="handleCurrentChange"
  50. :page-sizes="[10, 20, 30, 100]"
  51. :page-size="10"
  52. background
  53. style="margin-top:20px;float: right"
  54. layout="total, sizes, prev, pager, next, jumper"
  55. :total="total">
  56. </el-pagination>
  57. </div>
  58. <el-dialog title="新增" :visible.sync="newDialog">
  59. <el-form :model="form" ref="form" :rules="rules">
  60. <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
  61. <el-select v-model="form.inspectionMajor" placeholder="请选择检查大项" @change="changeInspection">
  62. <el-option
  63. v-for="item in InspectionMajor"
  64. :key="item.project_id"
  65. :value="item.project_id"
  66. :label="item.project_name"
  67. >
  68. </el-option>
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item label="检查小项" :label-width="formLabelWidth" required prop="inspectionMinor">
  72. <el-select v-model="form.inspectionMinor" placeholder="请选择检查小项" @change="changeInspectionMonior">
  73. <el-option
  74. v-for="it in InspectionMinor"
  75. :key="it.id"
  76. :value="it.id"
  77. :label="it.item_name"
  78. >
  79. </el-option>
  80. </el-select>
  81. </el-form-item>
  82. <el-form-item label="检查结果类型" :label-width="formLabelWidth" required prop="check_type">
  83. <el-radio
  84. @change="chageType"
  85. v-model="form.check_type"
  86. v-for="item in radioType"
  87. :key="item.label"
  88. :label="item.value"
  89. :value="item.label"
  90. >{{ item.label }}</el-radio>
  91. </el-form-item>
  92. <div style="display:flex;" v-show="showOne">
  93. <el-form-item label="质控范围" :label-width="formLabelWidth" required prop="min_range">
  94. <el-input style="width:200px" v-model="form.min_range"></el-input>
  95. </el-form-item>
  96. <span style="margin-top:10px">-</span>
  97. <el-form-item class='newFormItem' :label-width="formLabelWidth" required prop="large_range">
  98. <el-input style="width:200px" v-model="form.large_range"></el-input>
  99. </el-form-item>
  100. </div>
  101. <div v-show="showTwo">
  102. <el-form-item label="质控范围" :label-width="formLabelWidth" required prop="range_value">
  103. <el-input style="width:200px" v-model="form.range_value"></el-input>
  104. </el-form-item>
  105. </div>
  106. <el-form-item label="排序" :label-width="formLabelWidth">
  107. <el-input style="width:200px" v-model="form.sort"></el-input>
  108. </el-form-item>
  109. </el-form>
  110. <div slot="footer" class="dialog-footer">
  111. <el-button @click="newDialog = false">取 消</el-button>
  112. <el-button type="primary" @click="saveInspection('form')">保 存</el-button>
  113. </div>
  114. </el-dialog>
  115. <el-dialog title="编辑" :visible.sync="editDialog">
  116. <el-form :model="editform" ref="editform" :rules="rules">
  117. <el-form-item label="检查大项" :label-width="formLabelWidth" required prop="inspectionMajor">
  118. <el-select v-model="editform.inspectionMajor" placeholder="请选择检查大项" @change="changeInspectionTwo">
  119. <el-option
  120. v-for="patient in InspectionMajor"
  121. :key="patient.project_id"
  122. :value="patient.project_id"
  123. :label="patient.project_name"
  124. >
  125. </el-option>
  126. </el-select>
  127. </el-form-item>
  128. <el-form-item label="检查小项" :label-width="formLabelWidth" required prop="inspectionMinor">
  129. <el-select v-model="editform.inspectionMinor" placeholder="请选择检查小项" @change="changeInspectionMonior">
  130. <el-option
  131. v-for="item in InspectionMinorTwo"
  132. :key="item.id"
  133. :value="item.id"
  134. :label="item.item_name"
  135. >
  136. </el-option>
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item label="检查结果类型" :label-width="formLabelWidth" required prop="check_type">
  140. <el-radio
  141. @change = "chageType"
  142. v-model="editform.check_type"
  143. v-for="item in radioType"
  144. :key="item.label"
  145. :label="item.value"
  146. :value="item.label"
  147. >{{ item.label }}
  148. </el-radio>
  149. </el-form-item>
  150. <div style="display:flex;" v-show="showOne">
  151. <el-form-item label="质控范围" :label-width="formLabelWidth" required prop="min_range">
  152. <el-input style="width:200px" v-model="editform.min_range"></el-input>
  153. </el-form-item>
  154. <span style="margin-top:10px">-</span>
  155. <el-form-item class='newFormItem' :label-width="formLabelWidth" required prop="large_range">
  156. <el-input style="width:200px" v-model="editform.large_range"></el-input>
  157. </el-form-item>
  158. </div>
  159. <div v-show="showTwo">
  160. <el-form-item label="质控范围" :label-width="formLabelWidth" required prop="range_value">
  161. <el-input style="width:200px" v-model="editform.range_value"></el-input>
  162. </el-form-item>
  163. </div>
  164. <el-form-item label="排序" :label-width="formLabelWidth">
  165. <el-input style="width:200px" v-model="editform.sort"></el-input>
  166. </el-form-item>
  167. </el-form>
  168. <div slot="footer" class="dialog-footer">
  169. <el-button @click="editDialog = false">取 消</el-button>
  170. <el-button type="primary" @click="EditConfiguration('editform')">保 存</el-button>
  171. </div>
  172. </el-dialog>
  173. </div>
  174. </div>
  175. </template>
  176. <script>
  177. import { GetOICData } from "@/api/qcd";
  178. import PieChart from "../qcd/components/BarChart";
  179. import { uParseTime } from "@/utils/tools";
  180. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  181. import { getInspectionMajor,getInspectionMinor,getInspectionRange,saveConfiguration,getConfigurationList,getConfigurationDetail,getAllInspectionMinor,UpdateConfiguration,DeleteConfiguration,getLastSort }from "@/api/common/common";
  182. export default {
  183. name: "dialysisTotal",
  184. data() {
  185. return {
  186. crumbs: [
  187. { path: false, name: "质控管理" },
  188. { path: false, name: "统计配置" },
  189. { path: false, name: "质控达标统计配置" }
  190. ],
  191. radioType: [
  192. { value: 1, label: "数值类型" },
  193. { value: 2, label: "非数值类型" }
  194. ],
  195. tabActiveName: "control",
  196. InspectionMajor:[],
  197. InspectionMinor:[],
  198. InspectionMinorTwo:[],
  199. configuraData: [],
  200. newDialog: false,
  201. editDialog: false,
  202. formLabelWidth: "120px",
  203. form: {
  204. inspectionMajor: "",
  205. inspectionMinor: "",
  206. min_range: "",
  207. large_range: "",
  208. sort:"",
  209. check_type:"",
  210. range_value:"",
  211. },
  212. editform:{
  213. id:0,
  214. inspectionMajor: "",
  215. inspectionMinor: "",
  216. min_range: "",
  217. large_range: "",
  218. sort:"",
  219. check_type:"",
  220. range_value:"",
  221. },
  222. rules: {
  223. inspectionMajor: [{ required: true, message: "检查大项不能为空" }],
  224. inspectionMinor: [{ required: true, message: "检查小项不能为空" }],
  225. large_range:[{required:true,message:"质控范围不能为空"}],
  226. min_range:[{required:true,message:"质控范围不能为空"}],
  227. check_type:[{required:true,message:"检验类型不能为空"}],
  228. range_value:[{required:true,message:"参考值不能为空"}]
  229. },
  230. page:1,
  231. limit:10,
  232. total:0,
  233. showOne:true,
  234. showTwo:false,
  235. };
  236. },
  237. methods: {
  238. handleTabClick(tab, event) {
  239. if (this.tabActiveName == "query") {
  240. this.$router.push({ path: "/qcd/patientanalysis/checkStatistical" });
  241. }
  242. },
  243. //编辑
  244. handleEdit(id) {
  245. this.editDialog = true;
  246. getConfigurationDetail(id).then(response=>{
  247. if(response.data.state == 1){
  248. var configurationdetail = response.data.data.configurationdetail
  249. // console.log("详情",configurationdetail)
  250. this.editform.id = configurationdetail.id
  251. this.editform.inspectionMajor = configurationdetail.inspection_major
  252. this.editform.inspectionMinor = configurationdetail.inspection_minor
  253. this.editform.check_type = configurationdetail.range_type
  254. this.editform.range_value = configurationdetail.range_value
  255. if(configurationdetail.range_type == 1){
  256. this.showOne = true
  257. this.showTwo = false
  258. }
  259. if(configurationdetail.range_type == 2){
  260. this.showOne = false
  261. this.showTwo = true
  262. }
  263. if (configurationdetail.range_value == ""){
  264. this.editform.range_value = "0"
  265. }
  266. this.editform.large_range = configurationdetail.large_range
  267. this.editform.min_range = configurationdetail.min_range
  268. if(configurationdetail.sort == 0){
  269. this.editform.sort = ""
  270. return
  271. }
  272. this.editform.sort = configurationdetail.sort
  273. }
  274. })
  275. },
  276. //获取大项数据来源
  277. getInspectionMajor(){
  278. getInspectionMajor().then(response=>{
  279. if(response.data.state == 1){
  280. var inspection = response.data.data.inspection
  281. // console.log("大项是什么",inspection)
  282. this.InspectionMajor = inspection
  283. }
  284. })
  285. },
  286. //获取小项
  287. changeInspection(id){
  288. this.form.inspectionMinor = ""
  289. getInspectionMinor(id).then(response=>{
  290. if(response.data.state == 1){
  291. var inspection = response.data.data.inspection
  292. // console.log("小项",inspection)
  293. this.InspectionMinor = inspection
  294. }
  295. })
  296. },
  297. changeInspectionTwo(id){
  298. this.InspectionMinorTwo = []
  299. this.editform.inspectionMinor = ""
  300. getInspectionMinor(id).then(response=>{
  301. if(response.data.state == 1){
  302. var inspection = response.data.data.inspection
  303. // console.log("小项",inspection)
  304. this.InspectionMinorTwo = inspection
  305. }
  306. })
  307. },
  308. // 获取质控范围
  309. changeInspectionMonior(id){
  310. getInspectionRange(id).then(response=>{
  311. if(response.data.state == 1){
  312. var inspectionRange = response.data.data.inspectionRange
  313. // console.log("inspectionRange",inspectionRange)
  314. if(inspectionRange.range_type == 1){
  315. this.showOne = true
  316. this.showTwo = false
  317. this.form.check_type = 1
  318. this.editform.check_type = 1
  319. this.form.min_range = inspectionRange.range_min
  320. this.form.large_range = inspectionRange.range_max
  321. this.form.range_value = "0"
  322. }
  323. if(inspectionRange.range_type == 2){
  324. this.showOne = false
  325. this.showTwo = true
  326. this.form.check_type = 2
  327. this.editform.check_type = 2
  328. this.form.min_range = inspectionRange.range_min
  329. this.form.large_range = inspectionRange.range_max
  330. this.form.range_value = inspectionRange.range_value
  331. this.editform.range_value = inspectionRange.range_value
  332. }
  333. }
  334. })
  335. },
  336. saveInspection(formName){
  337. this.$refs[formName].validate(valid=>{
  338. if(valid){
  339. saveConfiguration(this.form).then(response=>{
  340. if(response.data.state == 1){
  341. var standard = response.data.data.standard
  342. this.$message.success("保存成功")
  343. this.newDialog = false
  344. this.form.inspectionMajor = ""
  345. this.form.inspectionMinor = ""
  346. this.form.large_range = ""
  347. this.form.min_range = ""
  348. this.form.sort = ""
  349. this.getConfigurationList()
  350. this.getLastSort()
  351. }else{
  352. this.$message.error("检查小项已存在")
  353. }
  354. })
  355. }
  356. })
  357. },
  358. handleSizeChange(limit) {
  359. this.limit = limit;
  360. this.getConfigurationList();
  361. },
  362. handleCurrentChange(page) {
  363. this.page = page;
  364. this.getConfigurationList();
  365. },
  366. getConfigurationList(){
  367. getConfigurationList(this.limit,this.page).then(response=>{
  368. if(response.data.state === 1){
  369. var configurationlist = response.data.data.configurationlist
  370. for(let i=0;i<configurationlist.length;i++){
  371. if(configurationlist[i].sort === 0){
  372. configurationlist[i].sort = ""
  373. }
  374. }
  375. // console.log("列表",configurationlist)
  376. this.configuraData = configurationlist
  377. var total = response.data.data.total
  378. // console.log("total",total)
  379. this.total = total
  380. }
  381. })
  382. },
  383. //获取小项
  384. getAllInspectionMinor(){
  385. getAllInspectionMinor().then(response=>{
  386. if(response.data.state == 1){
  387. var minor = response.data.data.minor
  388. this.InspectionMinorTwo = minor
  389. //console.log("minor",minor)
  390. }
  391. })
  392. },
  393. EditConfiguration(formName){
  394. if(this.editform.sort == ""){
  395. this.editform.sort = 0
  396. }
  397. if(this.editform.sort!=""){
  398. var sorts = this.editform.sort
  399. var sort = parseInt(sorts)
  400. this.editform.sort = sort
  401. }
  402. this.$refs[formName].validate(valid=>{
  403. if(valid){
  404. UpdateConfiguration(this.editform.id,this.editform).then(response=>{
  405. if(response.data.state == 1){
  406. var standard = response.data.data.standard
  407. // console.log("standard",standard)
  408. this.$message.success("保存成功")
  409. this.editDialog = false
  410. this.getConfigurationList()
  411. this.getAllInspectionMinor()
  412. }else{
  413. this.$message.error("检查小项已存在")
  414. }
  415. })
  416. }
  417. })
  418. },
  419. handleDelete(id,index) {
  420. this.$confirm(
  421. "确认要删除所选记录吗? <br>删除后,该信息将无法恢复",
  422. "删除提示",
  423. {
  424. dangerouslyUseHTMLString: true,
  425. confirmButtonText: "确定",
  426. cancelButtonText: "取消",
  427. type: "warning"
  428. }
  429. ).then(() => {
  430. DeleteConfiguration(id,index).then(response => {
  431. if (response.data.state === 1) {
  432. var msg = response.data.data.msg
  433. // console.log("msg",msg)
  434. this.configuraData.splice(index,1)
  435. }
  436. });
  437. });
  438. },
  439. getLastSort(){
  440. getLastSort().then(response=>{
  441. if(response.data.state === 1){
  442. var standard = response.data.data.standard
  443. // console.log("standard",standard)
  444. this.form.sort = standard.sort + 1+''
  445. }
  446. })
  447. },
  448. chageType(val){
  449. if(val == 1){
  450. this.showOne = true
  451. this.showTwo = false
  452. this.form.range_value = ""
  453. this.editform.range_value = ""
  454. }
  455. if(val == 2){
  456. this.showOne = false
  457. this.showTwo = true
  458. this.form.range_value = ""
  459. this.editform.range_value = ""
  460. }
  461. }
  462. },
  463. components: {
  464. PieChart,
  465. BreadCrumb
  466. },
  467. created() {
  468. //获取检查大项数据来源
  469. this.getInspectionMajor()
  470. //获取表格里面的数据
  471. this.getConfigurationList()
  472. //获取所有小项的数据
  473. this.getAllInspectionMinor()
  474. //获取排序值
  475. this.getLastSort()
  476. },
  477. };
  478. </script>
  479. <style lang="scss">
  480. #oictable ::-webkit-scrollbar {
  481. height: 15px;
  482. }
  483. .configTable {
  484. .el-table td,
  485. .el-table th {
  486. text-align: center;
  487. }
  488. }
  489. .newFormItem{
  490. .el-form-item__content{
  491. margin-left:0 !important;
  492. }
  493. }
  494. .statisticalConfig{
  495. .el-tabs{
  496. margin-bottom: 0 !important;
  497. }
  498. }
  499. </style>
  500. <style rel="stylesheet/scss" lang="scss" scoped>
  501. .newadd {
  502. margin-bottom: 10px;
  503. }
  504. // .app-container {
  505. // // margin: 20px;
  506. // font-size: 15px;
  507. // .filter-container {
  508. // padding-bottom: 5px;
  509. // }
  510. // .cqd-dataTitle {
  511. // color: #303133;
  512. // font-size: 14px;
  513. // border-bottom: 2px #e4e7ed solid;
  514. // height: 36px;
  515. // line-height: 36px;
  516. // margin: 0 0 25px 0;
  517. // position: relative;
  518. // }
  519. // .cqd-dataTitle::before {
  520. // position: absolute;
  521. // left: 0;
  522. // bottom: -2px;
  523. // content: "";
  524. // width: 42px;
  525. // height: 2px;
  526. // background: #409eff;
  527. // }
  528. // .search-component {
  529. // width: 500px;
  530. // .searchBox {
  531. // width: 300px;
  532. // height: 36px;
  533. // line-height: 36px;
  534. // padding-left: 15px;
  535. // border: 1px #dcdfe6 solid;
  536. // border-right: none;
  537. // outline: none;
  538. // float: left;
  539. // border-radius: 6px 0 0 6px;
  540. // font-size: 14px;
  541. // color: #333;
  542. // background: #fff;
  543. // box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  544. // }
  545. // .searchBtn {
  546. // background-color: #409eff;
  547. // color: #fff;
  548. // font-size: 15px;
  549. // text-align: center;
  550. // height: 36px;
  551. // line-height: 36px;
  552. // float: left;
  553. // outline: none;
  554. // width: 70px;
  555. // border: none;
  556. // border-radius: 0 6px 6px 0;
  557. // font-family: "Microsoft Yahei";
  558. // cursor: pointer;
  559. // }
  560. // }
  561. // .amount {
  562. // font-weight: normal;
  563. // padding: 10px 0 0 0;
  564. // color: #606266;
  565. // font-size: 14px;
  566. // span {
  567. // color: #ef2525;
  568. // font-family: "Arial";
  569. // padding: 0 2px;
  570. // }
  571. // }
  572. // }
  573. //
  574. </style>