drugStockOutOrderEdit.vue 27KB

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