drugStockInOrderEdit.vue 26KB

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