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

drugStockOutOrderAdd.vue 28KB

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