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

prescriptionTemplateTable.vue 31KB

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