prescriptionTable.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680
  1. <template>
  2. <div class="prescriptionTable">
  3. <el-table v-if="activeType == 1" :data="prescription.advices" border style="width: 99%;"
  4. :row-style="{ color: '#303133' }"
  5. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  6. <el-table-column align="center" prop="day" width="70" label="序号">
  7. <template slot-scope="scope">
  8. <div style="display:flex;align-items:center;">
  9. <el-input v-model="scope.row.groupno" placeholder=""></el-input>
  10. </div>
  11. </template>
  12. </el-table-column>
  13. <el-table-column align="center" prop="drug_name" label="名称">
  14. <template slot-scope="scope"><span :title="scope.row.drug_name">{{ scope.row.drug_name }}</span>
  15. </template>
  16. </el-table-column>
  17. <el-table-column align="center" prop="single_dose" width="120" label="单次用量">
  18. <template slot-scope="scope">
  19. <div style="display:flex;align-items:center;">
  20. <el-input v-model="scope.row.single_dose" @input="getAllChange(scope)"
  21. style="width:50%;"></el-input>
  22. <!-- <div>{{scope.row.single_dose_unit}}</div> -->
  23. <el-select v-model="scope.row.single_dose_unit" placeholder="请选择" style="width:50%;"
  24. @change="getAllChange(scope)">
  25. <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
  26. <el-option :label="scope.row.drug.dose_unit"
  27. v-if="scope.row.drug.dose_unit != scope.row.drug.min_unit"
  28. :value="scope.row.drug.dose_unit"></el-option>
  29. </el-select>
  30. </div>
  31. </template>
  32. </el-table-column>
  33. <el-table-column align="center" prop="delivery_way" width="100" label="用法">
  34. <template slot-scope="scope">
  35. <el-select v-model="scope.row.delivery_way" placeholder="请选择">
  36. <el-option
  37. v-for="(item,index) in drugways"
  38. :key="index"
  39. :label="item.name"
  40. :value="item.name">
  41. </el-option>
  42. </el-select>
  43. </template>
  44. </el-table-column>
  45. <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
  46. <template slot-scope="scope">
  47. <el-select v-model="scope.row.execution_frequency" placeholder="请选择" @change="getAllChange(scope)">
  48. <el-option
  49. v-for="item,index in efs"
  50. :key="index"
  51. :label="item.name"
  52. :value="item.name">
  53. </el-option>
  54. </el-select>
  55. </template>
  56. </el-table-column>
  57. <el-table-column align="center" prop="day" width="70" label="天数">
  58. <template slot-scope="scope">
  59. <div style="display:flex;align-items:center;">
  60. <el-input v-model="scope.row.day" @input="getAllChange(scope)" placeholder=""></el-input>
  61. {{'天'}}
  62. </div>
  63. </template>
  64. </el-table-column>
  65. <el-table-column align="center" prop="prescribing_number" width="120" label="总量">
  66. <template slot-scope="scope">
  67. <div style="display:flex;align-items:center;">
  68. <el-input v-model="scope.row.prescribing_number" @input="changePrescribingNumber(scope)"
  69. style="width:50%" placeholder=""></el-input>
  70. <!-- <div> {{scope.row.prescribing_number_unit}}</div> -->
  71. <el-select v-model="scope.row.prescribing_number_unit" placeholder="请选择" style="width:50%;"
  72. @change="getPrescribingNumberUnit(scope)">
  73. <el-option :label="scope.row.drug.min_unit" :value="scope.row.drug.min_unit"></el-option>
  74. <el-option :label="scope.row.drug.max_unit"
  75. v-if="scope.row.drug.min_unit != scope.row.drug.max_unit"
  76. :value="scope.row.drug.max_unit"></el-option>
  77. </el-select>
  78. </div>
  79. </template>
  80. </el-table-column>
  81. <el-table-column align="center" prop="retail_price" width="80" label="单价">
  82. <template slot-scope="scope">
  83. <div style="display:flex;align-items:center;">
  84. <el-input v-model="scope.row.retail_price" placeholder="" readonly></el-input>
  85. <div>{{'元'}}</div>
  86. </div>
  87. </template>
  88. </el-table-column>
  89. <el-table-column align="center" prop="hosp_appr_flag" width="100" label="医院审批标志">
  90. <template slot-scope="scope">
  91. <el-select v-model="scope.row.hosp_appr_flag" placeholder="请选择">
  92. <el-option label="审批通过" value="1"></el-option>
  93. <el-option label="无须审批" value="3"></el-option>
  94. <el-option label="审批不通过" value="2"></el-option>
  95. </el-select>
  96. </template>
  97. </el-table-column>
  98. <el-table-column align="center" prop="remark" width="50" label="备注">
  99. <template slot-scope="scope">
  100. <el-input v-model="scope.row.remark" :title="scope.row.remark" placeholder=""></el-input>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="center" width="40" prop="name" label="操作">
  104. <template slot-scope="scope">
  105. <i class="el-icon-delete" @click="deleteDrug(scope.$index, scope.row)"></i>
  106. </template>
  107. </el-table-column>
  108. </el-table>
  109. <el-table v-if="activeType == 2" :data="prescription.project" border style="width: 99%;"
  110. :row-style="{ color: '#303133' }"
  111. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  112. <el-table-column align="center" type="index" width="40" label="序号"></el-table-column>
  113. <el-table-column align="center" prop="project_name" label="名称">
  114. <template slot-scope="scope"><span :title="scope.row.project_name">{{ scope.row.project_name }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column align="center" prop="statistical_classification" width="100" label="组">
  118. <template slot-scope="scope">{{scope.row.statistical_classification}}
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="center" prop="single_dose" width="80" label="单次用量">
  122. <template slot-scope="scope">
  123. <div style="display:flex;align-items:center;">
  124. <el-input v-model="scope.row.single_dose" @input="getProjectSingleDose(scope)"
  125. placeholder=""></el-input>
  126. <div>{{scope.row.unit}}</div>
  127. </div>
  128. </template>
  129. </el-table-column>
  130. <el-table-column align="center" prop="delivery_way" width="80" label="用法">
  131. <template slot-scope="scope">
  132. <el-autocomplete
  133. style="width:100%;"
  134. class="inline-input"
  135. v-model="scope.row.delivery_way"
  136. :fetch-suggestions="querySearch2"
  137. placeholder="请输入内容"
  138. ></el-autocomplete>
  139. </template>
  140. </el-table-column>
  141. <el-table-column align="center" prop="execution_frequency" width="80" label="频率">
  142. <template slot-scope="scope">
  143. <el-input v-model="scope.row.execution_frequency" @input="getProjectSingleDose(scope)"
  144. placeholder=""></el-input>
  145. </template>
  146. </el-table-column>
  147. <el-table-column align="center" prop="number_days" width="70" label="天数">
  148. <template slot-scope="scope">
  149. <div style="display:flex;align-items:center;">
  150. <el-input v-model="scope.row.number_days" @input="getProjectSingleDose(scope)"
  151. placeholder=""></el-input>
  152. <div>{{'天'}}</div>
  153. </div>
  154. </template>
  155. </el-table-column>
  156. <el-table-column align="center" prop="total" width="70" label="总量">
  157. <template slot-scope="scope">
  158. <div style="display:flex;align-items:center;">
  159. <el-input v-model="scope.row.total" style="width:60%" placeholder=""></el-input>
  160. <div>{{scope.row.unit}}</div>
  161. </div>
  162. </template>
  163. </el-table-column>
  164. <el-table-column align="center" prop="name" width="70" label="单价">
  165. <template slot-scope="scope">
  166. <div style="display:flex;align-items:center;">
  167. <el-input v-model="scope.row.price" placeholder="" readonly></el-input>
  168. <div>{{'元'}}</div>
  169. </div>
  170. </template>
  171. </el-table-column>
  172. <el-table-column align="center" prop="name" width="50" label="备注">
  173. <template slot-scope="scope">
  174. <el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>
  175. </template>
  176. </el-table-column>
  177. <el-table-column align="center" width="40" prop="name" label="操作">
  178. <template slot-scope="scope">
  179. <i class="el-icon-delete" @click="deleteProject(scope.row,scope.$index)"></i>
  180. </template>
  181. </el-table-column>
  182. </el-table>
  183. <div class="additionalBox">
  184. <div class="additionalOne" v-for="(item,index) in prescription.addition" :key="index">
  185. <span :title="item.item_name">{{item.item_name}}</span>
  186. <el-input v-model="item.price" placeholder="" style="width:50px;"></el-input>
  187. <el-input v-model="item.count" placeholder="" style="width:50px;"></el-input>
  188. <i class="el-icon-delete deleteIcon" @click="delAddition(index,item)"></i>
  189. </div>
  190. </div>
  191. </div>
  192. </template>
  193. <script>
  194. import { getDictionaryDataConfig } from '@/utils/data'
  195. import { delHisAddition, delHisAdvice, delHisProject, getInitData,getHisDoctorAdviceInfo } from '@/api/his/his'
  196. export default {
  197. props: {
  198. preDrugs: Array,
  199. activeType: Number,
  200. addtions_charge: Array,
  201. prescription: {
  202. type: Object,
  203. default: function() {
  204. return {
  205. name: '',
  206. advices: [],
  207. project: [],
  208. drugways: [],
  209. efs: [],
  210. drugList:[],
  211. adviceList:{}
  212. }
  213. }
  214. }
  215. },
  216. data() {
  217. return {
  218. advices: [],
  219. tableData: [],
  220. newoptions: [{
  221. value: '1',
  222. label: '1'
  223. }, {
  224. value: '2',
  225. label: '2'
  226. }, {
  227. value: '3',
  228. label: '3'
  229. }, {
  230. value: '4',
  231. label: '4'
  232. }, {
  233. value: '5',
  234. label: '5'
  235. }],
  236. value: '1',
  237. input: 1,
  238. efs: [],
  239. drugways: []
  240. }
  241. },
  242. methods: {
  243. createFilter(queryString) {
  244. return (restaurant) => {
  245. return (restaurant.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0)
  246. }
  247. },
  248. querySearch2(queryString, cb) {
  249. var restaurants = this.getDictionaryDataConfig('system', 'project_use')
  250. restaurants.map(item => {
  251. item.value = item.name
  252. })
  253. var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
  254. // 调用 callback 返回建议列表的数据
  255. cb(results)
  256. },
  257. delAddition(index, addition) {
  258. if (this.prescription.order_status == 2) {
  259. this.$message.error('该处方已经结算,无法删除')
  260. return
  261. }
  262. this.$confirm('附加费删除后不可恢复,是否确认删除', '删除', {
  263. confirmButtonText: '确 定',
  264. cancelButtonText: '取 消',
  265. type: 'warning'
  266. }).then(() => {
  267. this.$nextTick(function() {
  268. if (addition.id == 0) {
  269. this.prescription.addition.splice(index, 1)
  270. } else {
  271. let params = {
  272. 'id': addition.id
  273. }
  274. delHisAddition(params).then(response => {
  275. if (response.data.state == 0) {
  276. this.$message.error(response.data.msg)
  277. return false
  278. } else {
  279. var temp2 = this.deepClone(this.prescription.addition)
  280. temp2.splice(index, 1)
  281. this.prescription.addition = temp2
  282. this.$message.success(response.data.data.msg)
  283. }
  284. })
  285. }
  286. })
  287. })
  288. .catch(() => {
  289. })
  290. },
  291. getInitData() {
  292. getInitData().then(response => {
  293. if (response.data.state == 0) {
  294. this.$message.error(response.data.msg)
  295. return false
  296. } else {
  297. this.drugways = response.data.data.drugways
  298. this.efs = response.data.data.efs
  299. this.drugList = response.data.data.drugs
  300. }
  301. })
  302. }, deleteDrug: function(index, row) {
  303. if (this.prescription.order_status == 2) {
  304. this.$message.error('该处方已经结算,无法删除')
  305. return
  306. }
  307. this.$confirm('药品删除后不可恢复,是否确认删除', '删除', {
  308. confirmButtonText: '确 定',
  309. cancelButtonText: '取 消',
  310. type: 'warning'
  311. }).then(() => {
  312. this.$nextTick(function() {
  313. if (row.advice_id == 0) {
  314. this.prescription.advices.splice(index, 1)
  315. } else {
  316. let params = {
  317. 'id': row.advice_id
  318. }
  319. delHisAdvice(params).then(response => {
  320. if (response.data.state == 0) {
  321. this.$message.error(response.data.msg)
  322. return false
  323. } else {
  324. var temp2 = this.deepClone(this.prescription.advices)
  325. temp2.splice(index, 1)
  326. this.prescription.advices = temp2
  327. this.$message.success(response.data.data.msg)
  328. }
  329. })
  330. }
  331. })
  332. })
  333. .catch(() => {
  334. })
  335. }, deepClone(source) {
  336. if (!source && typeof source !== 'object') {
  337. throw new Error('error arguments', 'shallowClone')
  338. }
  339. const targetObj = source.constructor === Array ? [] : {}
  340. Object.keys(source).forEach((keys) => {
  341. if (source[keys] && typeof source[keys] === 'object') {
  342. targetObj[keys] = this.deepClone(source[keys])
  343. } else {
  344. targetObj[keys] = source[keys]
  345. }
  346. })
  347. return targetObj
  348. },
  349. setNewData: function(data) {
  350. this.prescription = data
  351. // this.prescription.advices = data.advices
  352. },
  353. getDictionaryDataConfig(module, filed_name) {
  354. return getDictionaryDataConfig(module, filed_name)
  355. },
  356. getGroup(id) {
  357. var name = ''
  358. var statistics_category = getDictionaryDataConfig('system', 'statistics_category')
  359. // console.log('2235', statistics_category)
  360. for (let i = 0; i < statistics_category.length; i++) {
  361. if (id == statistics_category[i].id) {
  362. name = statistics_category[i].name
  363. }
  364. }
  365. return name
  366. },
  367. deleteProject(row, i) {
  368. if (this.prescription.order_status == 2) {
  369. this.$message.error('该处方已经结算,无法删除')
  370. return
  371. }
  372. this.$confirm('项目删除后不可恢复,是否确认删除', '删除', {
  373. confirmButtonText: '确 定',
  374. cancelButtonText: '取 消',
  375. type: 'warning'
  376. }).then(() => {
  377. if (row.id == 0) {
  378. this.prescription.project.splice(i, 1)
  379. } else {
  380. let params = {
  381. 'id': row.id
  382. }
  383. delHisProject(params).then(response => {
  384. if (response.data.state == 0) {
  385. this.$message.error(response.data.msg)
  386. return false
  387. } else {
  388. for (let i = 0; i < this.prescription.project.length; i++) {
  389. if (this.prescription.project[i].id == row.id) {
  390. this.prescription.project.splice(i, 1)
  391. }
  392. }
  393. this.$message.success(response.data.data.msg)
  394. }
  395. })
  396. }
  397. })
  398. .catch(() => {
  399. })
  400. },
  401. getAllChange(scope) {
  402. if (scope.row.drug.min_unit == scope.row.single_dose_unit) {
  403. if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
  404. console.log(1)
  405. scope.row.prescribing_number = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)
  406. } else {
  407. console.log(12)
  408. scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1)) * (scope.row.day ? scope.row.day : 1) / scope.row.drug.min_number)
  409. }
  410. } else {
  411. if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
  412. console.log(123)
  413. scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.drug.dose)
  414. } else {
  415. console.log(1234)
  416. scope.row.prescribing_number = Math.ceil((scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.day ? scope.row.day : 1)) / scope.row.drug.dose / scope.row.drug.min_number)
  417. }
  418. }
  419. if (scope.row.prescribing_number == 0) {
  420. scope.row.prescribing_number = 1
  421. }
  422. if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
  423. // scope.row.retail_price = scope.row.drug.min_number / scope.row.retail_price
  424. if (scope.row.prescribing_number > scope.row.drug.total) {
  425. this.$message.error(scope.row.drug_name + '库存不足')
  426. }
  427. } else {
  428. if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
  429. this.$message.error(scope.row.drug_name + '库存不足')
  430. }
  431. // scope.row.retail_price = scope.row.drug.retail_price * scope.row.prescribing_number
  432. }
  433. },
  434. getPrescribingNumberUnit(scope) {
  435. console.log('scope',scope)
  436. // if(scope.row.drug.min_unit == scope.row.single_dose_unit){
  437. // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
  438. // scope.row.prescribing_number = scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day
  439. // }else{
  440. // scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency)) * scope.row.day / scope.row.drug.min_number)
  441. // }
  442. // }else{
  443. // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
  444. // scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose)
  445. // }else{
  446. // scope.row.prescribing_number = Math.ceil((scope.row.single_dose * this.getNum(scope.row.execution_frequency) * scope.row.day) / scope.row.drug.dose / scope.row.drug.min_number)
  447. // }
  448. // }
  449. // if(scope.row.prescribing_number == 0){
  450. // scope.row.prescribing_number = 1
  451. // }
  452. if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
  453. scope.row.retail_price = scope.row.drug.min_price
  454. // if (scope.row.prescribing_number > scope.row.drug.total) {
  455. // this.$message.error(scope.row.drug_name + '库存不足')
  456. // }
  457. } else {
  458. // if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
  459. // this.$message.error(scope.row.drug_name + '库存不足')
  460. // }
  461. scope.row.retail_price = scope.row.drug.retail_price
  462. }
  463. },
  464. changePrescribingNumber(scope) {
  465. // var max_number = 0
  466. // if(scope.row.prescribing_number_unit == scope.row.drug.max_unit){
  467. // max_number = parseInt(scope.row.prescribing_number) * scope.row.drug.min_number
  468. // }
  469. // if(scope.row.prescribing_number_unit == scope.row.drug.min_unit){
  470. // max_number = parseInt(scope.row.prescribing_number)
  471. // }
  472. // console.log("修改的数量",max_number)
  473. // //查询该药品库存
  474. // if(this.drugList.length > 0){
  475. // var stock_number = 0
  476. // for(let i=0;i<this.drugList.length;i++){
  477. // if(scope.row.id == this.drugList[i].id){
  478. // for(let j=0;j<this.drugList[i].stock_in.length;j++){
  479. // stock_number += this.drugList[i].stock_in[j].stock_max_number * this.drugList[i].min_number + this.drugList[i].stock_in[j].stock_min_number
  480. // }
  481. // }
  482. // }
  483. // console.log("库存数量",stock_number)
  484. // }
  485. // if(scope.row.advice_id > 0){
  486. // //获取该药品上一次出库的的数量
  487. // getHisDoctorAdviceInfo(scope.row.advice_id).then(response=>{
  488. // if(response.data.state == 1){
  489. // var out_count = 0
  490. // var adviceList = response.data.data.advice
  491. // if(adviceList.prescribing_number_unit == adviceList.drug.max_number){
  492. // out_count = adviceList.prescribing_number * adviceList.drug.min_number
  493. // }
  494. // if(adviceList.prescribing_number_unit == adviceList.drug.min_unit){
  495. // out_count = adviceList.prescribing_number
  496. // }
  497. // //如果更改的数量大于修改之前的数量
  498. // if(max_number > out_count){
  499. // if((max_number - out_count)>stock_number){
  500. // this.$message.error(scope.row.drug_name + '库存不足')
  501. // }
  502. // }
  503. // }
  504. // })
  505. // }
  506. // if(scope.row.advice_id == 0){
  507. // if(max_number > stock_number){
  508. // this.$message.error(scope.row.drug_name + '库存不足')
  509. // }
  510. // }
  511. if (scope.row.prescribing_number_unit == scope.row.drug.min_unit) {
  512. if (parseInt(scope.row.prescribing_number) > scope.row.drug.total) {
  513. this.$message.error(scope.row.drug_name + '库存不足')
  514. }
  515. } else {
  516. if ((parseInt(scope.row.prescribing_number) * scope.row.drug.min_number) > scope.row.drug.total) {
  517. this.$message.error(scope.row.drug_name + '库存不足')
  518. }
  519. }
  520. },
  521. getProjectSingleDose(scope) {
  522. this.prescription.project[scope.$index].total = scope.row.single_dose * (scope.row.execution_frequency ? this.getNum(scope.row.execution_frequency) : 1) * (scope.row.number_days ? scope.row.number_days : 1)
  523. if (this.prescription.project[scope.$index].total == 0) {
  524. this.prescription.project[scope.$index].total = 1
  525. }
  526. },
  527. getProjectDay(scope) {
  528. this.prescription.project[scope.$index].total = scope.row.single_dose * scope.row.number_days
  529. if (this.prescription.project[scope.$index].total == 0) {
  530. this.prescription.project[scope.$index].total = 1
  531. }
  532. },
  533. getNum(execution_frequency) {
  534. let arr = [
  535. { name: '立即执行', count: 1 },
  536. { name: '透析时', count: 1 },
  537. { name: '透析1h一次', count: 1 },
  538. { name: '透析2h一次', count: 1 },
  539. { name: '透析3h一次', count: 1 },
  540. { name: '每日一次', count: 1 },
  541. { name: '每日两次', count: 2 },
  542. { name: '每日三次', count: 3 },
  543. { name: '每晚一次', count: 1 },
  544. { name: '每晚', count: 1 },
  545. { name: '上机前', count: 1 },
  546. { name: '下机前', count: 1 },
  547. { name: '透析后立即', count: 1 },
  548. { name: '持续使用', count: 1 },
  549. { name: '临时开药', count: 1 },
  550. { name: '临睡前', count: 1 },
  551. { name: '隔日一次', count: 1 },
  552. { name: '隔三日一次', count: 1 },
  553. { name: '每二小时一次', count: 12 },
  554. { name: '每四小时一次', count: 6 },
  555. { name: '每六小时一次', count: 4 },
  556. { name: '每八小时一次', count: 3 }
  557. ]
  558. let num = ''
  559. arr.map(item => {
  560. if (item.name == execution_frequency) {
  561. num = item.count
  562. }
  563. })
  564. if (num == '') {
  565. num = 1
  566. }
  567. return num
  568. },
  569. }, mounted() {
  570. this.getInitData()
  571. },
  572. watch: {
  573. 'prescription.advices': {
  574. handler(newVal, oldVal) {
  575. },
  576. deep: true
  577. }
  578. // "prescription.project":{
  579. // handler(newVal,oldVal){
  580. // newVal.map((item,index) => {
  581. // if(item.single_dose != oldVal[index].single_dose || item.number_days != oldVal[index].number_days){
  582. // item.total = item.single_dose * item.number_days
  583. // }
  584. // })
  585. // },
  586. // deep:true
  587. // }
  588. }
  589. }
  590. </script>
  591. <style lang="scss">
  592. .prescriptionTable {
  593. .el-input__inner {
  594. padding: 0 5px;
  595. }
  596. .additionalBox {
  597. margin-top: 20px;
  598. display: flex;
  599. flex-wrap: wrap;
  600. .additionalOne {
  601. margin-right: 20px;
  602. margin-bottom: 10px;
  603. display: flex;
  604. align-items: center;
  605. > span {
  606. white-space: nowrap;
  607. overflow: hidden;
  608. text-overflow: ellipsis;
  609. width: 80px;
  610. display: inline-block;
  611. font-size: 14px;
  612. }
  613. }
  614. .deleteIcon {
  615. color: red;
  616. margin-left: 5px;
  617. }
  618. }
  619. .el-table th .cell, .el-table td .cell {
  620. padding: 0 2px;
  621. white-space: pre-line;
  622. }
  623. .el-icon-delete {
  624. color: red;
  625. }
  626. }
  627. </style>