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

drugStockInOrderEdit.vue 30KB

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