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

drugStockInOrderEdit.vue 31KB

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