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

cancelDrugStockOrderAdd.vue 26KB

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