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

prescriptionTable.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. <template>
  2. <div class="prescriptionTable">
  3. <el-table v-if="activeType == 1" :data="prescription.advices" border style="width: 99%;" :row-style="{ color: '#303133' }"
  4. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  5. <el-table-column align="center" prop="drug_name" label="名称">
  6. <template slot-scope="scope">{{ scope.row.drug_name }}</template>
  7. </el-table-column>
  8. <el-table-column align="center" prop="single_dose" width="80" :label="'单次\n用量'">
  9. <template slot-scope="scope">
  10. <div style="display:flex;align-items:center;">
  11. <el-input v-model="scope.row.single_dose" style="width:60%;"></el-input>
  12. <div>{{scope.row.min_unit}}</div>
  13. </div>
  14. </template>
  15. </el-table-column>
  16. <el-table-column align="center" prop="delivery_way" width="100" label="用法">
  17. <template slot-scope="scope">
  18. <el-select v-model="scope.row.delivery_way" placeholder="请选择">
  19. <el-option
  20. v-for="(item,index) in drugways"
  21. :key="index"
  22. :label="item.name"
  23. :value="item.name">
  24. </el-option>
  25. </el-select>
  26. </template>
  27. </el-table-column>
  28. <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
  29. <template slot-scope="scope">
  30. <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
  31. <el-option
  32. v-for="item,index in efs"
  33. :key="index"
  34. :label="item.name"
  35. :value="item.name">
  36. </el-option>
  37. </el-select>
  38. </template>
  39. </el-table-column>
  40. <el-table-column align="center" prop="prescribing_number" width="80" label="总量">
  41. <template slot-scope="scope">
  42. <div style="display:flex;align-items:center;">
  43. <el-input v-model="scope.row.prescribing_number" style="width:60%" placeholder=""></el-input>
  44. <div> {{scope.row.min_unit}}</div>
  45. </div>
  46. </template>
  47. </el-table-column>
  48. <el-table-column align="center" prop="retail_price" width="60" label="单价">
  49. <template slot-scope="scope">
  50. <el-input v-model="scope.row.retail_price" placeholder=""></el-input>
  51. </template>
  52. </el-table-column>
  53. <el-table-column align="center" prop="remark" width="50" label="备注">
  54. <template slot-scope="scope">
  55. <el-input v-model="scope.row.remark" placeholder=""></el-input>
  56. </template>
  57. </el-table-column>
  58. <el-table-column align="center" width="40" prop="name" label="操作">
  59. <template slot-scope="scope">
  60. <i class="el-icon-delete" @click="deleteDrug(scope.$index, scope.row)"></i>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <el-table v-if="activeType == 2" :data="prescription.project" border style="width: 99%;" :row-style="{ color: '#303133' }"
  65. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  66. <!-- <el-table-column align="center" type="index" width="40" label="序号"></el-table-column> -->
  67. <el-table-column align="center" prop="project_name" label="名称">
  68. <template slot-scope="scope">{{ scope.row.project_name }}</template>
  69. </el-table-column>
  70. <el-table-column align="center" prop="statistical_classification" width="100" label="组">
  71. <template slot-scope="scope">
  72. {{getGroup(scope.row.statistical_classification)}}
  73. </template>
  74. </el-table-column>
  75. <el-table-column align="center" prop="single_dose" width="80" :label="'单次\n用量'">
  76. <template slot-scope="scope">
  77. <el-input v-model="scope.row.single_dose" placeholder=""></el-input>
  78. </template>
  79. </el-table-column>
  80. <el-table-column align="center" prop="delivery_way" width="50" label="用法">
  81. <template slot-scope="scope">
  82. <el-input v-model="scope.row.delivery_way" placeholder=""></el-input>
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="center" prop="execution_frequency" width="50" label="频率">
  86. <template slot-scope="scope">
  87. <el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>
  88. </template>
  89. </el-table-column>
  90. <el-table-column align="center" prop="number_days" width="50" label="天数">
  91. <template slot-scope="scope">
  92. <el-input v-model="scope.row.number_days" placeholder=""></el-input>
  93. </template>
  94. </el-table-column>
  95. <el-table-column align="center" prop="total" width="50" label="总量">
  96. <template slot-scope="scope">
  97. <div style="display:flex;">
  98. <el-input v-model="scope.row.total" style="width:50" placeholder=""></el-input>
  99. </div>
  100. </template>
  101. </el-table-column>
  102. <el-table-column align="center" prop="name" width="50" label="单价">
  103. <template slot-scope="scope">
  104. <el-input v-model="scope.row.price" placeholder=""></el-input>
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="center" prop="name" width="50" label="备注">
  108. <template slot-scope="scope">
  109. <el-input v-model="scope.row.remark"></el-input>
  110. </template>
  111. </el-table-column>
  112. <el-table-column align="center" width="40" prop="name" label="操作">
  113. <template slot-scope="scope">
  114. <i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>
  115. </template>
  116. </el-table-column>
  117. </el-table>
  118. <!--<div class="additionalBox">-->
  119. <!--<div class="additionalOne" v-for="(item,index) in 8" :key="index">-->
  120. <!--<span>治疗费</span>-->
  121. <!--<el-input v-model="input" placeholder="" style="width:50px;"></el-input>-->
  122. <!--共-->
  123. <!--<el-input v-model="input" placeholder="" style="width:50px;"></el-input>-->
  124. <!--次-->
  125. <!--<i class="el-icon-delete deleteIcon"></i>-->
  126. <!--</div>-->
  127. <!--</div>-->
  128. </div>
  129. </template>
  130. <script>
  131. import { getDictionaryDataConfig} from "@/utils/data";
  132. import { getInitData,delHisAdvice,delHisProject } from '@/api/his/his'
  133. export default {
  134. props: {
  135. preDrugs: Array,
  136. activeType: Number,
  137. prescription:{
  138. type:Object,
  139. default: function () {
  140. return {
  141. name:"",
  142. advices:[],
  143. project:[],
  144. drugways:[],
  145. efs:[],
  146. };
  147. }
  148. },
  149. },
  150. data() {
  151. return {
  152. advices:[],
  153. tableData: [],
  154. newoptions: [{
  155. value: '1',
  156. label: '1'
  157. }, {
  158. value: '2',
  159. label: '2'
  160. }, {
  161. value: '3',
  162. label: '3'
  163. }, {
  164. value: '4',
  165. label: '4'
  166. }, {
  167. value: '5',
  168. label: '5'
  169. }],
  170. value: '1',
  171. input: 1,
  172. }
  173. },
  174. methods:{
  175. getInitData(){
  176. getInitData().then(response => {
  177. if (response.data.state == 0) {
  178. this.$message.error(response.data.msg)
  179. return false
  180. } else {
  181. this.drugways = response.data.data.drugways
  182. this.efs = response.data.data.efs
  183. }
  184. })
  185. },deleteDrug:function(index, row){
  186. this.$confirm("药品删除后不可恢复,是否确认删除", "删除", {
  187. confirmButtonText: "确 定",
  188. cancelButtonText: "取 消",
  189. type: "warning"
  190. }).then(() => {
  191. this.$nextTick(function(){
  192. // this.prescription.advices.splice(index, 1)
  193. if(row.advice_id == 0){
  194. }else{
  195. let params = {
  196. 'id': row.advice_id,
  197. }
  198. delHisAdvice(params).then(response => {
  199. if (response.data.state == 0) {
  200. this.$message.error(response.data.msg)
  201. return false
  202. } else {
  203. var temp2 = this.deepClone(this.prescription.advices)
  204. temp2.splice(index, 1)
  205. this.prescription.advices = temp2
  206. this.$message.success(response.data.data.msg)
  207. }
  208. })
  209. }
  210. });
  211. })
  212. .catch(() => {});
  213. },deepClone(source) {
  214. if (!source && typeof source !== 'object') {
  215. throw new Error('error arguments', 'shallowClone')
  216. }
  217. const targetObj = source.constructor === Array ? [] : {}
  218. Object.keys(source).forEach((keys) => {
  219. if (source[keys] && typeof source[keys] === 'object') {
  220. targetObj[keys] = this.deepClone(source[keys])
  221. } else {
  222. targetObj[keys] = source[keys]
  223. }
  224. })
  225. return targetObj
  226. },
  227. setNewData:function(data){
  228. this.prescription = data
  229. // this.prescription.advices = data.advices
  230. },
  231. getDictionaryDataConfig(module, filed_name) {
  232. return getDictionaryDataConfig(module, filed_name)
  233. },
  234. getGroup(id){
  235. var name = ""
  236. var statistics_category = getDictionaryDataConfig('system','statistics_category')
  237. console.log("2235",statistics_category)
  238. for(let i=0;i<statistics_category.length;i++){
  239. if(id == statistics_category[i].id){
  240. name = statistics_category[i].name
  241. }
  242. }
  243. return name
  244. },
  245. deleteProject(row,i){
  246. console.log("row",row)
  247. this.$confirm("项目删除后不可恢复,是否确认删除", "删除", {
  248. confirmButtonText: "确 定",
  249. cancelButtonText: "取 消",
  250. type: "warning"
  251. }).then(() => {
  252. if(row.id == 0){
  253. this.prescription.project.splice(i, 1)
  254. }else{
  255. let params = {
  256. 'id': row.id,
  257. }
  258. delHisProject(params).then(response => {
  259. if (response.data.state == 0) {
  260. this.$message.error(response.data.msg)
  261. return false
  262. } else {
  263. for (let i = 0; i < this.prescription.project.length; i++){
  264. if(this.prescription.project[i].id == row.id){
  265. this.prescription.project.splice(i, 1)
  266. }
  267. }
  268. this.$message.success(response.data.data.msg)
  269. }
  270. })
  271. }
  272. })
  273. .catch(() => {});
  274. },
  275. },mounted(){
  276. this.getInitData()
  277. },
  278. }
  279. </script>
  280. <style lang="scss">
  281. .prescriptionTable {
  282. .additionalBox{
  283. margin-top: 20px;
  284. display: flex;
  285. flex-wrap: wrap;
  286. .additionalOne{
  287. margin-right:20px;
  288. margin-bottom:10px;
  289. display: flex;
  290. align-items: center;
  291. >span{
  292. white-space: nowrap;
  293. overflow: hidden;
  294. text-overflow: ellipsis;
  295. width:60px;
  296. display: inline-block;
  297. font-size: 14px;
  298. }
  299. }
  300. .deleteIcon{
  301. color:red;
  302. margin-left:5px;
  303. }
  304. }
  305. .el-table th .cell, .el-table td .cell {
  306. padding: 0 2px;
  307. white-space: pre-line;
  308. }
  309. .el-icon-delete {
  310. color: red;
  311. }
  312. }
  313. </style>