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

drugStockInOrderEdit.vue 26KB

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