drugStockOutOrderAdd.vue 26KB

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