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

cancelDrugStockOrderEdit.vue 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
  5. <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
  6. <div style="float:right;">
  7. <el-button size="small" @click="back()" class="filter-item" >取 消</el-button>
  8. <el-button size="small" type="primary" @click="submit()" class="filter-item" >保 存</el-button>
  9. </div>
  10. </div>
  11. <div class="app-container">
  12. <drugs-stock-dialog
  13. ref="dialog" :propForm="propForm"
  14. :visibility="isVisibility"
  15. v-on:dialog-comfirm="comfirm"
  16. v-on:dialog-cancle="cancle"
  17. >
  18. </drugs-stock-dialog>
  19. <div class="cell clearfix">
  20. <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
  21. <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
  22. <el-option
  23. v-for="(option, index) in houseList"
  24. :key="index"
  25. :label="option.storehouse_name"
  26. :value="option.id">
  27. </el-option>
  28. </el-select>
  29. <label class="title"><span class="name">退库时间</span> : </label>
  30. <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
  31. type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  32. value-format="yyyy-MM-dd"></el-date-picker>
  33. </div>
  34. <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
  35. <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  36. >
  37. <el-table-column align="center" width="200">
  38. <template slot="header" slot-scope="scope">
  39. <span>药品名称<span style="color: red">*</span></span>
  40. </template>
  41. <template slot-scope="scope">
  42. <el-form-item style="padding-top: 20px">
  43. <el-autocomplete
  44. class="checkSearch"
  45. popper-class="my-autocomplete"
  46. v-model="scope.row.drug_name"
  47. :fetch-suggestions="querySearchAsync"
  48. :trigger-on-focus="true"
  49. placeholder="请输入药品名称"
  50. @select="handleSelect"
  51. @input="changeDrugName(scope.$index)"
  52. style="width:160px;"
  53. >
  54. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  55. <template slot-scope="{ item }">
  56. <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + " "+item.manufacturer}}</div>
  57. </template>
  58. </el-autocomplete>
  59. </el-form-item>
  60. </template>
  61. </el-table-column>
  62. <el-table-column align="center" width="140">
  63. <template slot="header" slot-scope="scope">
  64. <span>规格&单位</span>
  65. </template>
  66. <template slot-scope="scope">
  67. <el-form-item style="padding-top: 20px">
  68. <el-input
  69. :disabled="true"
  70. placeholder="请输入规格&单位"
  71. v-model="scope.row.name"
  72. ></el-input>
  73. </el-form-item>
  74. </template>
  75. </el-table-column>
  76. <el-table-column width="200" align="center">
  77. <template slot="header" slot-scope="scope">
  78. <span>退库数量<span style="color: red">*</span></span>
  79. </template>
  80. <template slot-scope="scope">
  81. <el-form-item
  82. :prop="'recordData.' + scope.$index + '.count'"
  83. :rules="tableRules.count"
  84. style="padding-top: 17px"
  85. >
  86. <div style="display:flex;">
  87. <el-input
  88. oninput="value=value.replace(/\D|^0/g,'')"
  89. style="width:100px"
  90. placeholder="请输入退库数量"
  91. type="number"
  92. v-model="scope.row.count"
  93. ></el-input>
  94. <el-select v-model="scope.row.max_unit" filterable placeholder="请选择单位" style="width:80px">
  95. <el-option
  96. v-for="(option, index) in unitList"
  97. :key="index"
  98. :label="option.name"
  99. :value="option.name">
  100. </el-option>
  101. </el-select>
  102. </div>
  103. </el-form-item>
  104. </template>
  105. </el-table-column>
  106. <el-table-column align="center" width="150">
  107. <template slot="header" slot-scope="scope">
  108. <span>退库单价<span style="color: red">*</span></span>
  109. </template>
  110. <template slot-scope="scope">
  111. <el-form-item
  112. :prop="'recordData.' + scope.$index + '.price'"
  113. :rules="tableRules.price"
  114. style="padding-top: 17px"
  115. >
  116. <el-input
  117. placeholder="请输入单价"
  118. type="number"
  119. v-model="scope.row.price"
  120. ></el-input>
  121. </el-form-item>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="总价" align="center" width="150">
  125. <template slot-scope="scope">
  126. {{ calculate(scope.row.price * scope.row.count) }}
  127. </template>
  128. </el-table-column>
  129. <el-table-column width="200" align="center">
  130. <template slot="header" slot-scope="scope">
  131. <span>批次<span style="color: red"></span></span>
  132. </template>
  133. <template slot-scope="scope">
  134. <el-form-item
  135. :prop="'recordData.' + scope.$index + '.return_count'"
  136. style="padding-top: 17px"
  137. >
  138. <el-select v-model="scope.row.batch_number" filterable placeholder="请选择" :disabled="canCelShow">
  139. <el-option
  140. v-for="(item,index) in numberList"
  141. :key="index"
  142. :label="item.batch_number"
  143. :value="item.id">
  144. </el-option>
  145. </el-select>
  146. </el-form-item>
  147. </template>
  148. </el-table-column>
  149. <el-table-column width="200" align="center">
  150. <template slot="header" slot-scope="scope">
  151. <span>品名/注册证号(备案凭证号)<span style="color: red"></span></span>
  152. </template>
  153. <template slot-scope="scope">
  154. <el-form-item
  155. :prop="'recordData.' + scope.$index + '.register_account'"
  156. style="padding-top: 17px"
  157. >
  158. <el-input v-model="scope.row.register_account"></el-input>
  159. </el-form-item>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="生产厂家" width="160" align="center">
  163. <template slot-scope="scope">
  164. <el-select v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
  165. <el-option
  166. v-for="(option, index) in manufacturerList"
  167. :key="index"
  168. :label="option.manufacturer_name"
  169. :value="option.manufacturer_name">
  170. </el-option>
  171. </el-select>
  172. </template>
  173. </el-table-column>
  174. <el-table-column label="生产日期" width="180" align="center">
  175. <template slot-scope="scope">
  176. <el-date-picker
  177. prefix-icon="el-icon-date"
  178. style="width: 145px"
  179. v-model="scope.row.product_date"
  180. type="date"
  181. placeholder="选择日期时间"
  182. format="yyyy-MM-dd"
  183. value-format="yyyy-MM-dd"
  184. ></el-date-picker>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="有效日期" width="180" align="center">
  188. <template slot-scope="scope">
  189. <el-date-picker
  190. prefix-icon="el-icon-date"
  191. style="width: 145px"
  192. v-model="scope.row.expiry_date"
  193. type="date"
  194. placeholder="选择日期时间"
  195. format="yyyy-MM-dd"
  196. value-format="yyyy-MM-dd"
  197. ></el-date-picker>
  198. </template>
  199. </el-table-column>
  200. <el-table-column label="经销商" width="160" align="center">
  201. <template slot-scope="scope">
  202. <el-select v-model="scope.row.dealer" filterable placeholder="请选择厂商">
  203. <el-option
  204. v-for="(option, index) in dealerList"
  205. :key="index"
  206. :label="option.dealer_name"
  207. :value="option.dealer_name">
  208. </el-option>
  209. </el-select>
  210. </template>
  211. </el-table-column>
  212. <el-table-column width="200" align="center">
  213. <template slot="header" slot-scope="scope">
  214. <span>退库原因<span style="color: red"></span></span>
  215. </template>
  216. <template slot-scope="scope">
  217. <el-form-item
  218. :prop="'recordData.' + scope.$index + '.remark'"
  219. style="padding-top: 17px"
  220. >
  221. <el-input v-model="scope.row.remark"></el-input>
  222. </el-form-item>
  223. </template>
  224. </el-table-column>
  225. <el-table-column label="操作" align="center" width="200" fixed="right">
  226. <template slot-scope="scope">
  227. <el-tooltip
  228. class="item"
  229. effect="dark"
  230. content="新增"
  231. placement="top"
  232. >
  233. <el-button
  234. size="mini"
  235. type="primary"
  236. icon="el-icon-circle-plus-outline"
  237. @click="handleEdit(scope.$index, scope.row)"
  238. >
  239. </el-button>
  240. </el-tooltip>
  241. <el-tooltip
  242. class="item"
  243. effect="dark"
  244. content="删除"
  245. placement="top"
  246. >
  247. <el-button
  248. size="mini"
  249. type="danger"
  250. icon="el-icon-delete"
  251. @click="handleDelete(scope.$index, scope.row)"
  252. >
  253. </el-button>
  254. </el-tooltip>
  255. </template>
  256. </el-table-column>
  257. </el-table>
  258. </el-form>
  259. </div>
  260. </div>
  261. </template>
  262. <script>
  263. import { uParseTime } from '@/utils/tools'
  264. import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig,getDrugBatchNumber } from '@/api/drug/drug_stock'
  265. import BreadCrumb from '../../components/bread-crumb'
  266. import DrugsStockDialog from './drugsStockDialog/index'
  267. import {postSearchDrugList} from "@/api/data"
  268. export default {
  269. components: { DrugsStockDialog, BreadCrumb },
  270. name: 'cancelStockOrderEdit',
  271. data() {
  272. return {
  273. crumbs: [
  274. { path: false, name: '库存管理' },
  275. { path: false, name: '药品退库单' },
  276. { path: false, name: '编辑退库单' }
  277. ],
  278. crumbs2: [
  279. { path: false, name: '库存管理' },
  280. { path: false, name: '其他退库单' },
  281. { path: false, name: '编辑退库单' }
  282. ],
  283. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  284. warehousing_time: '',
  285. adminUserOptions: null,
  286. currentIndex: 0,
  287. return_time: '',
  288. recordInfo: {
  289. recordData: [],
  290. stock_in_code: '',
  291. current_index: ''
  292. },
  293. tableRules: {
  294. count: [
  295. { required: true, message: '数量不能为空', trigger: 'blur' }
  296. ]
  297. },
  298. ruleForm: {
  299. manufacturer: [
  300. { required: true, message: '请选择厂商', trigger: 'change' }
  301. ]
  302. },
  303. // prop
  304. isVisibility: false,
  305. propForm: {
  306. goods: [],
  307. goodType: [],
  308. goodInfo: [],
  309. goodUnit: [],
  310. manufacturer: 0,
  311. dealer: 0
  312. },
  313. form: {
  314. manufacturer: '',
  315. dealer: ''
  316. },
  317. warehouseOutInfoList:[],
  318. cancelStock: {},
  319. manufacturer: [],
  320. dealer: [],
  321. goodType: [],
  322. goodInfo:[],
  323. manufacturerList:[],
  324. dealerList:[],
  325. numberList:[],
  326. unitList:[],
  327. canCelShow:true,
  328. storehouse_id:"",
  329. houseList:[],
  330. }
  331. },
  332. methods: {
  333. comfirm: function(val) {
  334. this.$refs.dialog.hide()
  335. if (val.selectedGoodInfo.length > 0) {
  336. for (let i = val.selectedGoodInfo.length - 1; ; i--) {
  337. if (i == 0) {
  338. this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
  339. this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].last_price.toString()
  340. this.recordInfo.recordData[this.currentIndex].retail_price = val.selectedGoodInfo[i].retail_price.toString()
  341. } else {
  342. const tempForm = {}
  343. tempForm['id'] = 0
  344. tempForm['drug_id'] = val.selectedGoodInfo[i].id
  345. tempForm['count'] = ''
  346. tempForm['price'] = val.selectedGoodInfo[i].last_price.toString()
  347. tempForm['retail_price'] = val.selectedGoodInfo[i].retail_price.toString()
  348. this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
  349. }
  350. }
  351. }
  352. this.currentIndex = -1
  353. }, cancle: function() {
  354. this.$refs.dialog.hide()
  355. },
  356. calculate: function(val) {
  357. if (val == 0 || val == "NaN") {
  358. return ''
  359. }
  360. return Math.round(parseFloat(val) * 100) / 100
  361. },
  362. GetConfigInfo: function() {
  363. const loading = this.$loading({
  364. lock: true,
  365. text: 'Loading',
  366. spinner: 'el-icon-loading',
  367. background: 'rgba(0, 0, 0, 0.7)'
  368. })
  369. GetAllConfig().then(response => {
  370. if (response.data.state == 0) {
  371. this.$message.error(response.data.msg)
  372. return false
  373. } else {
  374. this.manufacturer = response.data.data.manufacturer;
  375. this.dealer = response.data.data.dealer;
  376. for(let i = 0; i< response.data.data.drugs.length;i++){
  377. this.goodType.push(response.data.data.drugs[i])
  378. if(response.data.data.drugs[i].drug_specs != null) {
  379. for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
  380. this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
  381. }
  382. }
  383. }
  384. this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
  385. this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
  386. }
  387. loading.close()
  388. })
  389. },
  390. typeName: function(drug_id) {
  391. let name = "";
  392. for (let i = 0; i < this.goodInfo.length; i++) {
  393. if (this.goodInfo[i].id == drug_id) {
  394. name = this.goodInfo[i].drug_name;
  395. }
  396. }
  397. return name;
  398. }, specificationName: function(drug_id) {
  399. let name = "";
  400. for (let i = 0; i < this.goodInfo.length; i++) {
  401. if (this.goodInfo[i].id == drug_id) {
  402. name = this.goodInfo[i].drug_spec;
  403. }
  404. }
  405. return name;
  406. },
  407. handleEdit: function(index, row) {
  408. this.canCelShow = false
  409. const tempObj = {}
  410. tempObj['id'] = 0
  411. tempObj["return_count"] = "";
  412. tempObj["price"] = 0;
  413. tempObj["retail_price"] = "";
  414. tempObj["register_account"] = ""
  415. tempObj["dealer"] = ""
  416. tempObj["manufacturer"] =""
  417. tempObj["remark"] = ""
  418. tempObj["product_date"] = ""
  419. tempObj["expiry_date"] = ""
  420. tempObj["batch_number"] = ""
  421. tempObj["batch_number_id"] = 0
  422. tempObj["count"] = 0
  423. this.recordInfo.recordData.push(tempObj)
  424. }, handleDelete: function(index, row) {
  425. if (row.id == 0) {
  426. this.recordInfo.recordData.splice(index, 1)
  427. } else {
  428. const params = {
  429. id: row.id
  430. }
  431. this.$confirm('确认删除该退库商品信息记录?', '删除退库商品信息记录', {
  432. confirmButtonText: '确定',
  433. cancelButtonText: '取消',
  434. type: 'warning'
  435. }).then(() => {
  436. deleteDrugCancelStockInfo(params).then(response => {
  437. if (response.data.state == 0) {
  438. this.$message.error(response.data.msg)
  439. return false
  440. } else {
  441. this.$message.success('删除成功')
  442. this.recordInfo.recordData.splice(index, 1)
  443. }
  444. })
  445. }).catch(() => {
  446. })
  447. }
  448. }, getTime(val, temp) {
  449. if (val != 0) {
  450. return uParseTime(val, temp)
  451. } else {
  452. return ''
  453. }
  454. },
  455. showDialog(index, row) {
  456. const loading = this.$loading({
  457. lock: true,
  458. text: 'Loading',
  459. spinner: 'el-icon-loading',
  460. background: 'rgba(0, 0, 0, 0.7)'
  461. })
  462. this.currentIndex = index
  463. this.isVisibility = true
  464. const params = {
  465. manufacturer_id: this.form.manufacturer,
  466. dealer_id: this.form.dealer
  467. }
  468. GetAllDrugInfoByID(params).then(response => {
  469. if (response.data.state == 0) {
  470. this.$message.error(response.data.msg)
  471. return false
  472. loading.close()
  473. } else {
  474. loading.close()
  475. if (response.data.data.drugs.length <= 0) {
  476. this.$message.error("该厂商或经销商没有药品信息");
  477. return;
  478. }
  479. this.$refs.dialog.show();
  480. for (let i = 0; i < response.data.data.drugs.length; i++) {
  481. this.propForm.goods.push(
  482. response.data.data.drugs[i]
  483. );
  484. }
  485. const obj = {};
  486. this.propForm.goods = this.propForm.goods.reduce(
  487. (cur, next) => {
  488. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  489. return cur;
  490. },
  491. []
  492. ); // 设置cur默认类型为数组,并且初始值为空的数组
  493. }
  494. for (let i = 0; i < this.propForm.goods.length; i++) {
  495. for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
  496. var respObj = this.propForm.goods[i].drug_specs[a];
  497. respObj["isSelected"] = false;
  498. }
  499. }
  500. loading.close();
  501. }
  502. )
  503. },
  504. back() {
  505. this.$router.go(-1)
  506. },
  507. submit() {
  508. this.$refs['tableForm'].validate((valid) => {
  509. if (valid) {
  510. const array = this.recordInfo.recordData
  511. for (let i = 0; i < array.length; i++) {
  512. if (array[i].drug_id == 0) {
  513. this.$message.error('药品名称或者药品规格名称不能为空')
  514. return
  515. }
  516. }
  517. for(let i=0;i<this.recordInfo.recordData.length;i++){
  518. for(let j=0;j<this.numberList.length;j++){
  519. if(this.recordInfo.recordData[i].batch_number == this.numberList[j].id){
  520. this.recordInfo.recordData[i].batch_number = this.numberList[j].batch_number
  521. this.recordInfo.recordData[i].batch_number_id = this.numberList[j].id
  522. }
  523. }
  524. this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
  525. }
  526. const params = {
  527. 'cancelStock': this.recordInfo.recordData
  528. }
  529. editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer,this.storehouse_id).then(response => {
  530. if (response.data.state == 0) {
  531. this.$message.error(response.data.msg)
  532. return false
  533. } else {
  534. if (response.data.data.msg == 1){
  535. this.$message.success('退库成功')
  536. this.$router.back(-1)
  537. }
  538. if(response.data.data.msg == 2){
  539. this.$message.error("该批次退库数量大于入库数量,请更改批次")
  540. }
  541. if(response.data.data.msg == 4){
  542. this.$message.error("该批次退库数量大于出库数量,请更改批次")
  543. }
  544. }
  545. })
  546. } else {
  547. return false
  548. }
  549. })
  550. },
  551. GetOrderDetail: function(order_id) {
  552. const params = {
  553. 'id': order_id
  554. }
  555. getDrugCancelStockInfo(params).then(response => {
  556. if (response.data.state == 0) {
  557. this.$message.error(response.data.msg)
  558. return false
  559. } else {
  560. for (let i = 0; i < response.data.data.list.length; i++) {
  561. response.data.data.list[i].count = response.data.data.list[i].count.toString()
  562. response.data.data.list[i].price = response.data.data.list[i].price.toString()
  563. response.data.data.list[i].retail_price = response.data.data.list[i].retail_price.toString()
  564. response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,'{y}-{m}-{d}')
  565. response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,'{y}-{m}-{d}')
  566. response.data.data.list[i].drug_name = response.data.data.list[i].drug.drug_name
  567. response.data.data.list[i].name = response.data.data.list[i].drug.dose +''+response.data.data.list[i].drug.dose_unit+"*"+response.data.data.list[i].drug.min_number+response.data.data.list[i].drug.min_unit+"/"+response.data.data.list[i].drug.max_unit
  568. this.recordInfo.recordData.push(response.data.data.list[i])
  569. }
  570. this.cancelStock = response.data.data.info
  571. this.storehouse_id = response.data.data.info.storehouse_id
  572. this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
  573. this.form.manufacturer = this.cancelStock.manufacturer
  574. this.form.dealer = this.cancelStock.dealer
  575. this.houseList = response.data.data.houselist
  576. }
  577. if (this.recordInfo.recordData.length == 0) {
  578. const tempObj = {}
  579. tempObj['id'] = 0
  580. tempObj['drug_id'] = 0
  581. tempObj['count'] = ''
  582. tempObj['price'] = ''
  583. tempObj['retail_price'] = ''
  584. this.recordInfo.recordData.push(tempObj)
  585. }
  586. })
  587. },changeManufacturer(val) {
  588. this.propForm.manufacturer = val
  589. },changeDealer(val){
  590. this.propForm.dealer = val
  591. },
  592. querySearchAsync(keyword, cb) {
  593. let key = '';
  594. if (keyword != undefined) {
  595. key = keyword
  596. }
  597. let searchArray = [];
  598. postSearchDrugList(key).then(response => {
  599. if (response.data.state == 1) {
  600. searchArray = response.data.data.list;
  601. var list = response.data.data.list
  602. this.drugList = list
  603. var manufacturerList = response.data.data.manufacturerList
  604. this.manufacturerList = manufacturerList
  605. var dealerList = response.data.data.dealerList
  606. this.dealerList = dealerList
  607. for(let i=0;i<this.drugList.length;i++){
  608. for(let j=0;j<this.manufacturerList.length;j++){
  609. if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
  610. this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
  611. }
  612. }
  613. for(let z=0;z<dealerList.length;z++){
  614. if(this.drugList[i].dealer == this.dealerList[z].id){
  615. this.drugList[i].dealer = this.dealerList[z].dealer_name
  616. }
  617. }
  618. }
  619. cb(this.drugList)
  620. } else {
  621. cb([])
  622. }
  623. })
  624. },
  625. changeDrugName(val){
  626. this.currentIndex = val
  627. },
  628. handleSelect(val){
  629. var arr = []
  630. for(let i=0;i<this.recordInfo.recordData.length;i++){
  631. arr.push(this.recordInfo.recordData[i].drug_id)
  632. }
  633. var str = arr.join(",")
  634. if(str.indexOf(val.id)!=-1){
  635. this.$message.error("该药品已存在列表中")
  636. return
  637. }
  638. this.getDrugBatchNumber(val.id)
  639. for(let i=0;i<this.recordInfo.recordData.length;i++){
  640. if(i == this.currentIndex){
  641. this.recordInfo.recordData[i].drug_id = val.id
  642. this.recordInfo.recordData[i].drug_name = val.drug_name
  643. this.recordInfo.recordData[i].drug_type = val.drug_type
  644. this.recordInfo.recordData[i].name = val.dose +val.dose_unit+"*"+val.min_number+ val.min_unit+"/"+val.max_unit
  645. this.recordInfo.recordData[i].last_price = val.last_price
  646. this.recordInfo.recordData[i].price = val.last_price
  647. this.recordInfo.recordData[i].manufacturer = val.manufacturer
  648. this.recordInfo.recordData[i].number = val.number
  649. this.recordInfo.recordData[i].max_unit = val.max_unit
  650. this.recordInfo.recordData[i].min_unit = val.min_unit
  651. if(val.dealer == 0){
  652. this.recordInfo.recordData[i].dealer = ""
  653. }else{
  654. this.recordInfo.recordData[i].dealer = val.dealer
  655. }
  656. }
  657. }
  658. },
  659. getDrugBatchNumber(id){
  660. var params = {
  661. id:id
  662. }
  663. getDrugBatchNumber(params).then(response=>{
  664. if(response.data.state == 1){
  665. var list = response.data.data.list
  666. for(let i=0;i<list.length;i++){
  667. this.numberList.push(list[i])
  668. }
  669. }
  670. })
  671. },
  672. getDataConfig(module, filed_name){
  673. return getDataConfig(module, filed_name)
  674. },
  675. },
  676. created() {
  677. this.GetConfigInfo()
  678. this.propForm.goodUnit = this.$store.getters.good_unit
  679. const order_id = this.$route.query.id
  680. this.GetOrderDetail(order_id)
  681. }
  682. }
  683. </script>
  684. <style rel="stylesheet/css" lang="scss" scoped>
  685. .information {
  686. border: 1px #dcdfe6 solid;
  687. padding: 30px 20px 30px 20px;
  688. .border {
  689. border-bottom: 1px #dcdfe6 solid;
  690. margin: 0px 0 20px 0;
  691. }
  692. }
  693. .edit_separater {
  694. border-top: 1px solid rgb(233, 233, 233);
  695. margin-top: 15px;
  696. margin-bottom: 15px;
  697. }
  698. </style>
  699. <style>
  700. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  701. font-size: 12px;
  702. }
  703. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  704. background: #6fb5fa;
  705. }
  706. </style>