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

drugStockInOrderEdit.vue 29KB

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