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

drugStockInOrderEdit.vue 35KB

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