monthPrescriptionTable.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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" type="index" width="40" label="序号"></el-table-column>
  6. <el-table-column align="center" prop="drug_name" label="名称">
  7. <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span></template>
  8. </el-table-column>
  9. <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
  10. <template slot-scope="scope">
  11. <div style="display:flex;align-items:center;">
  12. <el-input v-model="scope.row.single_dose" style="width:65%;"></el-input>
  13. <div>{{scope.row.single_dose_unit}}</div>
  14. </div>
  15. </template>
  16. </el-table-column>
  17. <el-table-column align="center" prop="delivery_way" width="100" label="用法">
  18. <template slot-scope="scope">
  19. <el-select v-model="scope.row.delivery_way" placeholder="请选择">
  20. <el-option
  21. readonly
  22. v-for="(item,index) in drugways"
  23. :key="index"
  24. :label="item.name"
  25. :value="item.name">
  26. </el-option>
  27. </el-select>
  28. </template>
  29. </el-table-column>
  30. <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
  31. <template slot-scope="scope">
  32. <el-select v-model="scope.row.execution_frequency" placehold er="请选择">
  33. <el-option
  34. readonly
  35. v-for="item,index in efs"
  36. :key="index"
  37. :label="item.name"
  38. :value="item.name">
  39. </el-option>
  40. </el-select>
  41. </template>
  42. </el-table-column>
  43. <el-table-column align="center" prop="day" width="50" label="天数">
  44. <template slot-scope="scope">
  45. <div style="display:flex;align-items:center;">
  46. <el-input v-model="scope.row.day" placeholder="" readonly></el-input>
  47. <span>{{'天'}}</span>
  48. </div>
  49. </template>
  50. </el-table-column>
  51. <el-table-column align="center" prop="prescribing_number" width="80" label="总量">
  52. <template slot-scope="scope">
  53. <div style="display:flex;align-items:center;">
  54. <el-input v-model="scope.row.prescribing_number" style="width:60%" placeholder="" readonly></el-input>{{scope.row.prescribing_number_unit}}
  55. </div>
  56. </template>
  57. </el-table-column>
  58. <el-table-column align="center" prop="retail_price" width="70" label="单价">
  59. <template slot-scope="scope">
  60. <div style="display:flex;align-items:center;">
  61. <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>{{'元'}}
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column align="center" prop="remark" width="50" label="备注">
  66. <template slot-scope="scope">
  67. <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder="" readonly></el-input>
  68. </template>
  69. </el-table-column>
  70. </el-table>
  71. <el-table v-if="activeType == 2" :data="prescription.project" border style="width: 99%;" :row-style="{ color: '#303133' }"
  72. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  73. <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
  74. <el-table-column align="center" prop="project_name" label="名称">
  75. <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span></template>
  76. </el-table-column>
  77. <el-table-column align="center" prop="statistical_classification" width="100" label="组">
  78. <template slot-scope="scope">{{getGroup(scope.row.statistical_classification)}}</template>
  79. </el-table-column>
  80. <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
  81. <template slot-scope="scope">
  82. <el-input v-model="scope.row.single_dose" placeholder="" readonly></el-input>
  83. <div>{{scope.row.unit}}</div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column align="center" prop="delivery_way" width="80" label="用法">
  87. <template slot-scope="scope">
  88. <el-autocomplete
  89. readonly
  90. style="width:100%;"
  91. class="inline-input"
  92. v-model="scope.row.delivery_way"
  93. :fetch-suggestions="querySearch2"
  94. placeholder="请输入内容"
  95. ></el-autocomplete>
  96. </template>
  97. </el-table-column>
  98. <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
  99. <template slot-scope="scope">
  100. <el-input v-model="scope.row.execution_frequency" placeholder="" readonly></el-input>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="center" prop="number_days" width="50" label="天数">
  104. <template slot-scope="scope">
  105. <div style="display:flex;align-items:center;">
  106. <el-input v-model="scope.row.number_days" placeholder="" readonly></el-input>
  107. <div>{{'天'}}</div>
  108. </div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column align="center" prop="total" width="70" label="总量">
  112. <template slot-scope="scope">
  113. <div style="display:flex;align-items:center;">
  114. <el-input v-model="scope.row.total" style="width:60%" placeholder="" readonly></el-input>
  115. <div>{{scope.row.unit}}</div>
  116. </div>
  117. </template>
  118. </el-table-column>
  119. <el-table-column align="center" prop="name" width="70" label="单价">
  120. <template slot-scope="scope">
  121. <div style="display:flex;align-items:center;">
  122. <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
  123. <div>{{'元'}}</div>
  124. </div>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="center" prop="name" width="50" label="备注">
  128. <template slot-scope="scope">
  129. <el-input v-model="scope.row.remark" :title="scope.row.remark" readonly></el-input>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <div class="additionalBox">
  134. <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
  135. <span :title="item.item_name">{{item.item_name}}</span>
  136. <el-input v-model="item.price" placeholder="" style="width:50px;"></el-input>
  137. <el-input v-model="item.count" placeholder="" style="width:50px;"></el-input>
  138. <i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>
  139. </div>
  140. </div>
  141. </div>
  142. </template>
  143. <script>
  144. import { getDictionaryDataConfig} from "@/utils/data";
  145. import { getInitData,delHisAdvice,delHisProject,delHisAddition } from '@/api/his/his'
  146. export default {
  147. props: {
  148. preDrugs: Array,
  149. activeType: Number,
  150. addtions_charge:Array,
  151. prescription:{
  152. type:Object,
  153. default: function () {
  154. return {
  155. name:"",
  156. advices:[],
  157. project:[],
  158. drugways:[],
  159. efs:[],
  160. };
  161. }
  162. },
  163. },
  164. data() {
  165. return {
  166. advices:[],
  167. tableData: [],
  168. newoptions: [{
  169. value: '1',
  170. label: '1'
  171. }, {
  172. value: '2',
  173. label: '2'
  174. }, {
  175. value: '3',
  176. label: '3'
  177. }, {
  178. value: '4',
  179. label: '4'
  180. }, {
  181. value: '5',
  182. label: '5'
  183. }],
  184. value: '1',
  185. input: 1,
  186. }
  187. },
  188. methods:{
  189. createFilter(queryString) {
  190. return (restaurant) => {
  191. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  192. }
  193. },
  194. querySearch2(queryString, cb) {
  195. var restaurants = this.getDictionaryDataConfig("system","project_use")
  196. restaurants.map(item => {
  197. item.value = item.name
  198. })
  199. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  200. // 调用 callback 返回建议列表的数据
  201. cb(results)
  202. },
  203. getInitData(){
  204. getInitData().then(response => {
  205. if (response.data.state == 0) {
  206. this.$message.error(response.data.msg)
  207. return false
  208. } else {
  209. this.drugways = response.data.data.drugways
  210. this.efs = response.data.data.efs
  211. }
  212. })
  213. },
  214. deepClone(source) {
  215. if (!source && typeof source !== 'object') {
  216. throw new Error('error arguments', 'shallowClone')
  217. }
  218. const targetObj = source.constructor === Array ? [] : {}
  219. Object.keys(source).forEach((keys) => {
  220. if (source[keys] && typeof source[keys] === 'object') {
  221. targetObj[keys] = this.deepClone(source[keys])
  222. } else {
  223. targetObj[keys] = source[keys]
  224. }
  225. })
  226. return targetObj
  227. },
  228. setNewData:function(data){
  229. this.prescription = data
  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. for(let i=0;i<statistics_category.length;i++){
  238. if(id == statistics_category[i].id){
  239. name = statistics_category[i].name
  240. }
  241. }
  242. return name
  243. },
  244. },mounted(){
  245. this.getInitData()
  246. },
  247. }
  248. </script>
  249. <style lang="scss">
  250. .prescriptionTable {
  251. .el-input__inner {
  252. padding: 0 5px;
  253. }
  254. .additionalBox {
  255. margin-top: 20px;
  256. display: flex;
  257. flex-wrap: wrap;
  258. .additionalOne {
  259. margin-right: 20px;
  260. margin-bottom: 10px;
  261. display: flex;
  262. align-items: center;
  263. > span {
  264. white-space: nowrap;
  265. overflow: hidden;
  266. text-overflow: ellipsis;
  267. width: 80px;
  268. display: inline-block;
  269. font-size: 14px;
  270. }
  271. .deleteIcon {
  272. color: red;
  273. margin-left: 5px;
  274. }
  275. }
  276. .el-table th .cell, .el-table td .cell {
  277. padding: 0 2px;
  278. white-space: pre-line;
  279. }
  280. .el-icon-delete {
  281. color: red;
  282. }
  283. }
  284. }
  285. </style>