stockInOrder.vue 46KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
  5. <bread-crumb :crumbs="crumbs"></bread-crumb>
  6. <el-button
  7. size="small"
  8. @click="handleWarehouse"
  9. class="filter-item"
  10. style="float:right;"
  11. type="primary"
  12. icon="el-icon-circle-plus-outline"
  13. >新增</el-button
  14. >
  15. </div>
  16. <div class="app-container">
  17. <div class="cell clearfix">
  18. <el-input
  19. size="small"
  20. style="width: 400px;"
  21. v-model.trim="searchKey"
  22. class="filter-item"
  23. placeholder="单据编码/制单人/厂商"
  24. />
  25. <el-button
  26. size="small"
  27. class="filter-item"
  28. type="primary"
  29. icon="el-icon-search"
  30. @click="search"
  31. >搜索</el-button
  32. >
  33. </div>
  34. <div class="cell clearfix">
  35. <label class="title"><span class="name">入库时间</span> : </label>
  36. <el-date-picker
  37. size="small"
  38. v-model="start_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. @change="startTimeChange"
  48. ></el-date-picker>
  49. <span class="cellLine"> - </span>
  50. <el-date-picker
  51. size="small"
  52. v-model="end_time"
  53. prefix-icon="el-icon-date"
  54. :editable="false"
  55. style="width: 196px;"
  56. type="date"
  57. placeholder="选择日期时间"
  58. align="right"
  59. format="yyyy-MM-dd"
  60. value-format="yyyy-MM-dd"
  61. @change="endTimeChange"
  62. ></el-date-picker>
  63. </div>
  64. <div class="cell clearfix">
  65. <el-checkbox
  66. style="width: 70px"
  67. v-model="checked"
  68. @change="changeAllSelected"
  69. >全选</el-checkbox
  70. >
  71. <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
  72. <el-button size="small" type="primary" @click="toPrint">打印</el-button>
  73. </div>
  74. <el-table
  75. :data="Warehouse.warehouseDate"
  76. :class="signAndWeighBoxPatients"
  77. style="width: 100%"
  78. border
  79. highlight-current-row
  80. v-loading="Warehouse.loading"
  81. ref="multipleTable"
  82. @selection-change="select"
  83. :row-style="{ color: '#303133' }"
  84. :header-cell-style="{
  85. backgroundColor: 'rgb(245, 247, 250)',
  86. color: '#606266'
  87. }"
  88. @current-change="handleSearch"
  89. >
  90. <el-table-column align="center" type="selection" width="55">
  91. </el-table-column>
  92. <el-table-column label="单据日期" align="center">
  93. <template slot-scope="scope">
  94. {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="单据编号" align="center">
  98. <template slot-scope="scope">
  99. {{ scope.row.warehousing_order }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="制单人" align="center">
  103. <template slot-scope="scope">
  104. {{ getXuserName(scope.row.creater) }}
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="操作" align="center" width="260px">
  108. <template slot-scope="scope">
  109. <!-- <el-tooltip
  110. class="item"
  111. effect="dark"
  112. content="详情"
  113. placement="top"
  114. >
  115. <el-button
  116. size="small"
  117. type="warning"
  118. icon="el-icon-document"
  119. @click="handleSearch(scope.row.id)"
  120. >
  121. </el-button>
  122. </el-tooltip> -->
  123. <el-tooltip
  124. class="item"
  125. effect="dark"
  126. content="编辑"
  127. placement="top"
  128. >
  129. <el-button
  130. size="small"
  131. type="primary"
  132. icon="el-icon-edit-outline"
  133. @click="handleEdit(scope.$index, scope.row)"
  134. >
  135. </el-button>
  136. </el-tooltip>
  137. <el-tooltip
  138. class="item"
  139. effect="dark"
  140. content="删除"
  141. placement="top"
  142. >
  143. <el-button
  144. size="small"
  145. type="danger"
  146. icon="el-icon-delete"
  147. @click="handleDelete(scope.$index, scope.row)"
  148. >
  149. </el-button>
  150. </el-tooltip>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <el-pagination
  155. @size-change="handleSizeChange"
  156. @current-change="handleCurrentChange"
  157. :page-sizes="[5, 10, 50, 100]"
  158. :page-size="5"
  159. background
  160. style="margin-top:20px;text-align: right"
  161. layout="total, sizes, prev, pager, next, jumper"
  162. :total="total"
  163. >
  164. </el-pagination>
  165. <div v-show="tableShow" style="margin-top:10px;">
  166. <el-table
  167. :data="tableList"
  168. :class="signAndWeighBoxPatients"
  169. style="width: 100%"
  170. border
  171. highlight-current-row
  172. v-loading="Warehouse.loading"
  173. ref="multipleTable"
  174. @selection-change="select"
  175. :row-style="{ color: '#303133' }"
  176. :header-cell-style="{
  177. backgroundColor: 'rgb(245, 247, 250)',
  178. color: '#606266'
  179. }"
  180. >
  181. <el-table-column label="耗材名称" align="center">
  182. <template slot-scope="scope">
  183. {{ scope.row.GoodInfo.good_name }}
  184. </template>
  185. </el-table-column>
  186. <el-table-column label="耗材类型" align="center">
  187. <template slot-scope="scope">
  188. {{ getTypeName(scope.row.GoodInfo.good_type_id)}}
  189. </template>
  190. </el-table-column>
  191. <el-table-column label="规格&单位" align="center">
  192. <template slot-scope="scope">
  193. {{ scope.row.GoodInfo.specification_name}} * {{scope.row.GoodInfo.min_number}}{{scope.row.GoodInfo.min_unit}}
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="批号" align="center">
  197. <template slot-scope="scope">
  198. {{ scope.row.number}}
  199. </template>
  200. </el-table-column>
  201. <el-table-column label="入库数量" align="center">
  202. <template slot-scope="scope">
  203. {{ scope.row.warehousing_count}}
  204. </template>
  205. </el-table-column>
  206. <el-table-column label="进货价" align="center">
  207. <template slot-scope="scope">
  208. {{ scope.row.price}}
  209. </template>
  210. </el-table-column>
  211. <el-table-column label="总价" align="center">
  212. <template slot-scope="scope">
  213. {{ (scope.row.warehousing_count * scope.row.price).toFixed(2)}}
  214. </template>
  215. </el-table-column>
  216. <el-table-column label="生产厂家" align="center">
  217. <template slot-scope="scope">
  218. {{ getManufactuerName(scope.row.GoodInfo.manufacturer)}}
  219. </template>
  220. </el-table-column>
  221. <el-table-column label="生产日期" align="center">
  222. <template slot-scope="scope">
  223. {{ getTime(scope.row.product_date)}}
  224. </template>
  225. </el-table-column>
  226. <el-table-column label="有效期" align="center">
  227. <template slot-scope="scope">
  228. {{ getTime(scope.row.expiry_date)}}
  229. </template>
  230. </el-table-column>
  231. <el-table-column label="备注" align="center">
  232. <template slot-scope="scope">
  233. {{ scope.row.remark }}
  234. </template>
  235. </el-table-column>
  236. </el-table>
  237. </div>
  238. </div>
  239. <el-dialog
  240. title="详情"
  241. :visible.sync="dialogVisible"
  242. width="80%"
  243. >
  244. <span>
  245. <div>
  246. <el-row>
  247. <span style="font-size: 18px;color: #606266">入库单详情</span>
  248. </el-row>
  249. <el-row style="float:left;">
  250. <span style="color: #606266"
  251. >入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span
  252. >
  253. </el-row>
  254. </div>
  255. <div class="cell clearfix">
  256. <span style="width: 300px;color: #606266;float:right">单据日期:{{ WarehouseInfo.warehouse.warehousing_time | parseTime("{y}-{m}-{d}")}} </span>
  257. <span style="width: 300px;color: #606266;float:right">厂商:{{ getManufactuerName(WarehouseInfo.warehouse.manufacturer) }}</span>
  258. <span style="width: 300px;color: #606266"
  259. >经销商:{{ getDealerName(WarehouseInfo.warehouse.dealer) }} </span>
  260. </div>
  261. <div class="cell clearfix" style="margin-top: 10px">
  262. <el-button size="small" icon="el-icon-edit" @click="editRecord"
  263. >编辑</el-button
  264. >
  265. <el-button size="small" icon="el-icon-delete" @click="deleteRecord"
  266. >删除</el-button
  267. >
  268. <el-row :gutter="12" style="margin-top: 10px">
  269. <el-table
  270. :data="WarehouseInfo.warehouseInfoDate"
  271. :class="signAndWeighBoxPatients"
  272. style="width: 100%"
  273. border
  274. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  275. >
  276. <el-table-column min-width="35" align="center">
  277. <template slot="header" slot-scope="scope">
  278. <span>耗材类型</span>
  279. </template>
  280. <template slot-scope="scope">
  281. <span v-if="scope.row.good_type_id != 0">{{
  282. getTypeName(scope.row.good_type_id)
  283. }}</span>
  284. </template>
  285. </el-table-column>
  286. <el-table-column min-width="35" align="center">
  287. <template slot="header" slot-scope="scope">
  288. <span>耗材名称</span>
  289. </template>
  290. <template slot-scope="scope">
  291. <span v-if="scope.row.good_id != 0">{{
  292. getTypeNameOne(scope.row.good_id)
  293. }}</span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column min-width="35" align="center">
  297. <template slot="header" slot-scope="scope">
  298. <span>规格型号</span>
  299. </template>
  300. <template slot-scope="scope">
  301. <span v-if="scope.row.good_id != 0">{{
  302. getSpecificationName(scope.row.good_id)
  303. }}</span>
  304. </template>
  305. </el-table-column>
  306. <el-table-column min-width="23" align="center">
  307. <template slot="header" slot-scope="scope">
  308. <span>进货价</span>
  309. </template>
  310. <template slot-scope="scope">
  311. <span>{{ scope.row.price }}</span>
  312. </template>
  313. </el-table-column>
  314. <el-table-column min-width="23" align="center">
  315. <template slot="header" slot-scope="scope">
  316. <span>入库数量</span>
  317. </template>
  318. <template slot-scope="scope">
  319. <span>{{ scope.row.warehousing_count }}</span>
  320. </template>
  321. </el-table-column>
  322. <el-table-column label="总价" min-width="20" align="center">
  323. <template slot-scope="scope">
  324. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  325. </template>
  326. </el-table-column>
  327. <el-table-column align="center" min-width="25">
  328. <template slot="header" slot-scope="scope">
  329. <span>批号</span>
  330. </template>
  331. <template slot-scope="scope">
  332. <span>{{ scope.row.number }}</span>
  333. </template>
  334. </el-table-column>
  335. <el-table-column label="生产日期" min-width="40" align="center">
  336. <template v-if="scope.row.product_date != 0" slot-scope="scope">
  337. {{ scope.row.product_date }}
  338. </template>
  339. </el-table-column>
  340. <el-table-column label="有效日期" min-width="40" align="center">
  341. <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
  342. {{ scope.row.expiry_date }}
  343. </template>
  344. </el-table-column>
  345. <el-table-column label="备注" min-width="20" align="center">
  346. <template slot-scope="scope">
  347. <el-popover placement="top-start" width="250" trigger="hover">
  348. <div>{{ scope.row.remark }}</div>
  349. <span slot="reference" v-if="scope.row.remark.length > 20">{{
  350. scope.row.remark.substr(0, 20) + "..."
  351. }}</span>
  352. <span slot="reference" v-else>{{ scope.row.remark }}</span>
  353. </el-popover>
  354. </template>
  355. </el-table-column>
  356. </el-table>
  357. </el-row>
  358. </div>
  359. </span>
  360. <span slot="footer" class="dialog-footer">
  361. <el-button @click="dialogVisible = false">取 消</el-button>
  362. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  363. </span>
  364. </el-dialog>
  365. <el-dialog
  366. title="新增"
  367. :visible.sync="editDialogVisible"
  368. width="80%"
  369. >
  370. <span>
  371. <div style="margin-bottom:10px">
  372. <label class="title"><span class="name">入库时间</span> : </label>
  373. <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
  374. style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  375. value-format="yyyy-MM-dd"></el-date-picker>
  376. <label class="title" style="margin-left:10px;"><span class="name">经 销 商</span> : </label>
  377. <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
  378. <el-option
  379. v-for="(option, index) in dealer"
  380. :key="index"
  381. :label="option.dealer_name"
  382. :value="option.id">
  383. </el-option>
  384. </el-select>
  385. <label class="title" style="margin-left:10px;"><span class="name">厂商</span> : </label>
  386. <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
  387. <el-option
  388. v-for="(option, index) in manufacturer"
  389. :key="index"
  390. :label="option.manufacturer_name"
  391. :value="option.id">
  392. </el-option>
  393. </el-select>
  394. </div>
  395. <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
  396. <el-table
  397. id="oictable"
  398. :data="recordInfo.recordData"
  399. :class="signAndWeighBoxPatients"
  400. style="width: 100%"
  401. border
  402. max-height="450"
  403. :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
  404. >
  405. <el-table-column align="center" width="200">
  406. <template slot="header" slot-scope="scope">
  407. <span>商品类型<span style="color: red">*</span></span>
  408. </template>
  409. <template slot-scope="scope">
  410. <el-form-item style="padding-top: 15px">
  411. <el-input
  412. placeholder="请输入商品类型"
  413. v-model="scope.row.good_type_id"
  414. :value="typeName(scope.row.good_type_id)"
  415. @focus="showDialog(scope.$index, scope.row)"
  416. ></el-input>
  417. </el-form-item>
  418. </template>
  419. </el-table-column>
  420. <el-table-column align="center" width="200">
  421. <template slot="header" slot-scope="scope">
  422. <span>规格名称<span style="color: red">*</span></span>
  423. </template>
  424. <template slot-scope="scope">
  425. <el-form-item style="padding-top: 15px">
  426. <el-input
  427. placeholder="请输入规格名称"
  428. v-model="scope.row.good_id"
  429. :value="specificationName(scope.row.good_id)"
  430. @focus="showDialog(scope.$index, scope.row)"
  431. ></el-input>
  432. </el-form-item>
  433. </template>
  434. </el-table-column>
  435. <el-table-column align="center" width="150">
  436. <template slot="header" slot-scope="scope">
  437. <span>单价<span style="color: red">*</span></span>
  438. </template>
  439. <template slot-scope="scope">
  440. <!--<el-input type="number" v-model="scope.row.price" @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
  441. <el-form-item
  442. :prop="'recordData.' + scope.$index + '.price'"
  443. :rules="tableRules.price"
  444. style="padding-top: 17px"
  445. >
  446. <el-input
  447. placeholder="请输入单价"
  448. type="number"
  449. v-model="scope.row.price"
  450. ></el-input>
  451. </el-form-item>
  452. </template>
  453. </el-table-column>
  454. <el-table-column align="center" width="180">
  455. <template slot="header" slot-scope="scope">
  456. <span>入库数量<span style="color: red">*</span></span>
  457. </template>
  458. <template slot-scope="scope">
  459. <!--{{scope.row.warehousing_count}}-->
  460. <!--<el-input type="number" v-model="scope.row.warehousing_count" @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
  461. <el-form-item
  462. :prop="'recordData.' + scope.$index + '.warehousing_count'"
  463. :rules="tableRules.warehousing_count"
  464. style="padding-top: 17px"
  465. >
  466. <el-input
  467. placeholder="请输入入库数量"
  468. type="number"
  469. v-model="scope.row.warehousing_count"
  470. ></el-input>
  471. </el-form-item>
  472. </template>
  473. </el-table-column>
  474. <el-table-column label="总价" align="center" width="150">
  475. <template slot-scope="scope">
  476. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  477. </template>
  478. </el-table-column>
  479. <el-table-column align="center" width="150">
  480. <template slot="header" slot-scope="scope">
  481. <span>批号</span>
  482. </template>
  483. <template slot-scope="scope">
  484. <el-form-item style="padding-top: 15px">
  485. <el-input
  486. placeholder="请输入批号"
  487. v-model="scope.row.number"
  488. ></el-input>
  489. </el-form-item>
  490. </template>
  491. </el-table-column>
  492. <el-table-column label="生产日期" width="250" align="center">
  493. <template slot-scope="scope">
  494. <el-date-picker
  495. prefix-icon="el-icon-date"
  496. style="width: 145px"
  497. v-model="scope.row.product_date"
  498. type="date"
  499. placeholder="选择日期时间"
  500. format="yyyy-MM-dd"
  501. value-format="yyyy-MM-dd"
  502. ></el-date-picker>
  503. </template>
  504. </el-table-column>
  505. <el-table-column label="有效日期" width="250" align="center">
  506. <template slot-scope="scope">
  507. <el-date-picker
  508. prefix-icon="el-icon-date"
  509. style="width: 145px"
  510. v-model="scope.row.expiry_date"
  511. type="date"
  512. placeholder="选择日期时间"
  513. format="yyyy-MM-dd"
  514. value-format="yyyy-MM-dd"
  515. ></el-date-picker>
  516. </template>
  517. </el-table-column>
  518. <el-table-column label="备注" width="150" align="center">
  519. <template slot-scope="scope">
  520. <el-input v-model="scope.row.remark"></el-input>
  521. </template>
  522. </el-table-column>
  523. <el-table-column
  524. label="操作"
  525. fixed="right"
  526. align="center"
  527. width="150"
  528. >
  529. <template slot-scope="scope">
  530. <el-tooltip
  531. class="item"
  532. effect="dark"
  533. content="新增"
  534. placement="top"
  535. >
  536. <el-button
  537. size="mini"
  538. type="primary"
  539. icon="el-icon-circle-plus-outline"
  540. @click="handleEditTwo(scope.$index, scope.row)"
  541. >
  542. </el-button>
  543. </el-tooltip>
  544. <el-tooltip
  545. class="item"
  546. effect="dark"
  547. content="删除"
  548. placement="top"
  549. >
  550. <el-button
  551. size="mini"
  552. type="danger"
  553. icon="el-icon-delete"
  554. @click="DeleteWarehouseInfoItem(scope.$index, scope.row)"
  555. >
  556. </el-button>
  557. </el-tooltip>
  558. </template>
  559. </el-table-column>
  560. </el-table>
  561. </el-form>
  562. </span>
  563. <span slot="footer" class="dialog-footer">
  564. <el-button @click="editDialogVisible = false">取 消</el-button>
  565. <el-button type="primary" @click="submit()">保 存</el-button>
  566. </span>
  567. </el-dialog>
  568. <stock-in-dialog
  569. ref="dialog"
  570. :propForm="propForm"
  571. :visibility="isVisibility"
  572. v-on:dialog-comfirm="comfirm"
  573. v-on:dialog-cancle="cancle">
  574. </stock-in-dialog>
  575. </div>
  576. </template>
  577. <script>
  578. import stockInDialog from "./Dialog/stockInDialog";
  579. import { uParseTime } from "@/utils/tools";
  580. import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
  581. import {
  582. deleteWarehouseInfo,
  583. GetAllConfig,
  584. GetAllGoodInfo,
  585. GetAllGoodType,
  586. getWarehouseInfoList,
  587. getWarehouseList,
  588. DeleteWarehouseInfoItem,
  589. GetAllGoodInfoByID,
  590. EditWarehouse
  591. } from "@/api/stock";
  592. import { GetAllDrugInfoByID,postDrugWarehouse} from "@/api/drug/drug_stock";
  593. import BreadCrumb from "../components/bread-crumb";
  594. export default {
  595. name: "stockIn",
  596. components: { BreadCrumb, stockInDialog },
  597. created() {
  598. var nowDate = new Date();
  599. var nowYear = nowDate.getFullYear();
  600. var nowMonth = nowDate.getMonth() + 1;
  601. var nowDay = nowDate.getDate();
  602. this.end_time =
  603. nowYear +
  604. "-" +
  605. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  606. "-" +
  607. (nowDay < 10 ? "0" + nowDay : nowDay);
  608. nowDate.setMonth(nowDate.getMonth() - 1);
  609. nowYear = nowDate.getFullYear();
  610. nowMonth = nowDate.getMonth() + 1;
  611. nowDay = nowDate.getDate();
  612. this.start_time =
  613. nowYear +
  614. "-" +
  615. (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
  616. "-" +
  617. (nowDay < 10 ? "0" + nowDay : nowDay);
  618. this.GetWarehouse();
  619. this.GetConfigInfo();
  620. this.fetchAllAdminUsers();
  621. this.GetAllGoodType()
  622. this.GetAllGoodInfo()
  623. },
  624. data() {
  625. var checkGoodId = (rule, value, callback) => {
  626. setTimeout(() => {
  627. if (value == "" || value == 0) {
  628. return callback(new Error("规格名称不能为空"));
  629. }
  630. }, 2000);
  631. };
  632. return {
  633. crumbs: [
  634. { path: false, name: "库存管理" },
  635. { path: false, name: "入库单" }
  636. ],
  637. searchKey: "",
  638. type: 1,
  639. page: 1,
  640. limit: 5,
  641. checked: false,
  642. total: 0,
  643. pageTotal: 0,
  644. pageSelect: 0,
  645. adminUserOptions: [],
  646. multipleSelection: [],
  647. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  648. start_time: "",
  649. end_time: "",
  650. goodType: [],
  651. goodInfo: [],
  652. manufacturer: [],
  653. selectedTableData: [],
  654. dealer: [],
  655. Warehouse: {
  656. loading: false,
  657. warehouseDate: [],
  658. tableCurrentIndex: ""
  659. },
  660. WarehouseInfo: {
  661. loading: false,
  662. warehouseInfoDate: [],
  663. warehouse: {}
  664. },
  665. startTime: "",
  666. dialogVisible:false,
  667. editDialogVisible:false,
  668. recordInfo: {
  669. recordData: [],
  670. stock_in_code: "",
  671. current_index: ""
  672. },
  673. tableRules: {
  674. price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
  675. warehousing_count: [
  676. { required: true, message: "数量不能为空", trigge: "blur" }
  677. ],
  678. good_id: [{ validator: checkGoodId, trigger: "blur" }]
  679. },
  680. form: {
  681. manufacturer:0,
  682. dealer:0
  683. },
  684. warehousing_time: '',
  685. warehouse:{},
  686. propForm: {
  687. goods: [],
  688. goodType: [],
  689. goodInfo: [],
  690. goodUnit: [],
  691. title: '入库',
  692. formValue: {
  693. good_type_id: '',
  694. good_id: '',
  695. number: '',
  696. product_date: '',
  697. expiry_date: '',
  698. warehousing_count: '',
  699. price: '',
  700. remark: '',
  701. dealer: '',
  702. manufacturer: ''
  703. },
  704. isCreated: 1,
  705. isVisibility: false,
  706. drug_id:1,
  707. },
  708. drug_id:1,
  709. tableShow:false,
  710. tableList:[],
  711. isVisibility:false,
  712. order_id:0,
  713. };
  714. },
  715. methods: {
  716. search: function() {
  717. const Params = {
  718. page: this.page,
  719. limit: this.limit,
  720. start_time: this.start_time,
  721. end_time: this.end_time,
  722. type: this.type,
  723. keywords: this.searchKey
  724. };
  725. this.Warehouse.warehouseDate = [];
  726. getWarehouseList(Params).then(response => {
  727. if (response.data.state == 0) {
  728. this.Warehouse.loading = false;
  729. this.$message.error(response.data.msg);
  730. return false;
  731. } else {
  732. this.Warehouse.loading = false;
  733. this.total = response.data.data.total;
  734. for (let i = 0; i < response.data.data.list.length; i++) {
  735. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  736. }
  737. }
  738. });
  739. },
  740. GetWarehouse: function() {
  741. const Params = {
  742. page: this.page,
  743. limit: this.limit,
  744. start_time: this.start_time,
  745. end_time: this.end_time,
  746. type: this.type
  747. };
  748. console.log("parasm22222",Params)
  749. this.Warehouse.warehouseDate = [];
  750. getWarehouseList(Params).then(response => {
  751. if (response.data.state == 0) {
  752. this.Warehouse.loading = false;
  753. this.$message.error(response.data.msg);
  754. return false;
  755. } else {
  756. this.Warehouse.loading = false;
  757. this.total = response.data.data.total;
  758. for (let i = 0; i < response.data.data.list.length; i++) {
  759. this.Warehouse.warehouseDate.push(response.data.data.list[i]);
  760. }
  761. }
  762. });
  763. },
  764. tableRowClassName({ row, rowIndex }) {
  765. // 把每一行的索引放进row
  766. row.index = rowIndex;
  767. },
  768. onRowClick(row, event, column) {
  769. this.WarehouseInfo.warehouseInfoDate = [];
  770. this.Warehouse.tableCurrentIndex = row.index;
  771. const params = {
  772. id: row.id
  773. };
  774. this.WarehouseInfo.loading = true;
  775. getWarehouseInfoList(params).then(response => {
  776. if (response.data.state == 0) {
  777. this.WarehouseInfo.loading = false;
  778. this.$message.error(response.data.msg);
  779. return false;
  780. } else {
  781. this.WarehouseInfo.loading = false;
  782. for (let i = 0; i < response.data.data.info.length; i++) {
  783. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  784. }
  785. }
  786. });
  787. },
  788. getXuserName(id) {
  789. if (id <= 0) {
  790. return "";
  791. }
  792. var name = "";
  793. if (
  794. this.adminUserOptions == null ||
  795. typeof this.adminUserOptions.length === "undefined"
  796. ) {
  797. return name;
  798. }
  799. var leng = this.adminUserOptions.length;
  800. if (leng == 0) {
  801. return name;
  802. }
  803. for (let index = 0; index < leng; index++) {
  804. if (this.adminUserOptions[index].id == id) {
  805. name = this.adminUserOptions[index].name;
  806. break;
  807. }
  808. }
  809. return name;
  810. },
  811. fetchAllDoctorAndNurse() {
  812. fetchAllDoctorAndNurse().then(response => {
  813. if (response.data.state == 1) {
  814. this.doctorOptions = response.data.data.doctors;
  815. }
  816. });
  817. },
  818. fetchAllAdminUsers() {
  819. fetchAllAdminUsers().then(response => {
  820. console.log(response);
  821. if (response.data.state == 1) {
  822. this.adminUserOptions = response.data.data.users;
  823. var alen = this.adminUserOptions.length;
  824. for (let index = 0; index < alen; index++) {
  825. if (this.adminUserOptions[index].user_type == 2) {
  826. // this.doctorOptions.push(this.adminUserOptions[index]);
  827. }
  828. }
  829. }
  830. });
  831. },
  832. getSpecificationName: function(id) {
  833. let name = "";
  834. for (let i = 0; i < this.goodInfo.length; i++) {
  835. if (this.goodInfo[i].id == id) {
  836. name = this.goodInfo[i].specification_name;
  837. }
  838. }
  839. return name;
  840. },
  841. getTypeName: function(id) {
  842. let name = "";
  843. for (let i = 0; i < this.goodType.length; i++) {
  844. if (this.goodType[i].id == id) {
  845. name = this.goodType[i].type_name;
  846. }
  847. }
  848. return name;
  849. },
  850. getTypeNameOne:function(id){
  851. console.log("999999",this.goodInfo)
  852. let name = "";
  853. for (let i = 0; i < this.goodInfo.length; i++) {
  854. if (this.goodInfo[i].id == id) {
  855. name = this.goodInfo[i].good_name;
  856. }
  857. }
  858. return name;
  859. },
  860. GetAllGoodType: function() {
  861. GetAllGoodType().then(response => {
  862. if (response.data.state == 0) {
  863. this.$message.error(response.data.msg);
  864. return false;
  865. } else {
  866. for (let i = 0; i < response.data.data.goodType.length; i++) {
  867. this.goodType.push(response.data.data.goodType[i]);
  868. }
  869. }
  870. });
  871. },
  872. GetAllGoodInfo: function() {
  873. GetAllGoodInfo().then(response => {
  874. if (response.data.state == 0) {
  875. this.$message.error(response.data.msg);
  876. return false;
  877. } else {
  878. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  879. this.goodInfo.push(response.data.data.goodInfo[i]);
  880. }
  881. }
  882. });
  883. },
  884. clicks: function() {
  885. console.log(this.WarehouseInfo.warehouseInfoDate);
  886. },
  887. handleWarehouse: function() {
  888. this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
  889. },
  890. handleReturnSales: function() {
  891. // this.$router.push({path:'/patients/create'}
  892. if (this.multipleSelection.length <= 0) {
  893. this.$message.error("请选择退货商品");
  894. return;
  895. }
  896. const ids = [];
  897. for (let i = 0; i < this.multipleSelection.length; i++) {
  898. ids.push(this.multipleSelection[i].id);
  899. }
  900. this.$router.push({ name: "salesReturn", query: { id: ids.join("&") } });
  901. },
  902. handleReturnSalesRecord: function() {
  903. this.$router.push({ name: "salesReutrnRecord" });
  904. },
  905. handleWarehouseRecord: function() {
  906. this.$router.push({ name: "warehouseRecord" });
  907. },
  908. handleSelectionChange: function(val) {
  909. this.multipleSelection = val;
  910. },
  911. handleSizeChange(val) {
  912. this.limit = val;
  913. this.GetWarehouse();
  914. },
  915. handleCurrentChange(val) {
  916. this.page = val;
  917. this.GetWarehouse();
  918. },
  919. startTimeChange(val) {
  920. var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
  921. if (time > 0) {
  922. this.$message.error("结束时间不能小于开始时间");
  923. this.start_time = "";
  924. } else {
  925. this.startTime = this.getTimestamp(val);
  926. this.GetWarehouse();
  927. }
  928. },
  929. endTimeChange(val) {
  930. var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
  931. if (time < 0) {
  932. this.$message.error("结束时间不能小于开始时间");
  933. this.end_time = "";
  934. } else {
  935. this.GetWarehouse();
  936. }
  937. },
  938. getTimestamp(time) {
  939. // 把时间日期转成时间戳
  940. return new Date(time).getTime() / 1000;
  941. },
  942. getTime(val, temp) {
  943. if (val != 0) {
  944. return uParseTime(val, temp);
  945. } else {
  946. return "";
  947. }
  948. },
  949. calculate: function(val) {
  950. return Math.round(parseFloat(val) * 100) / 100;
  951. },
  952. GetConfigInfo: function() {
  953. GetAllConfig().then(response => {
  954. if (response.data.state == 0) {
  955. this.$message.error(response.data.msg);
  956. return false;
  957. } else {
  958. this.manufacturer = response.data.data.manufacturer;
  959. this.dealer = response.data.data.dealer;
  960. this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
  961. this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
  962. }
  963. });
  964. },
  965. getManufactuerName: function(manufacturer_id) {
  966. for (let i = 0; i < this.manufacturer.length; i++) {
  967. if (this.manufacturer[i].id == manufacturer_id) {
  968. return this.manufacturer[i].manufacturer_name;
  969. }
  970. }
  971. },
  972. getDealerName: function(dealer_id) {
  973. for (let i = 0; i < this.dealer.length; i++) {
  974. if (this.dealer[i].id == dealer_id) {
  975. return this.dealer[i].dealer_name;
  976. }
  977. }
  978. },
  979. handleEdit: function(index, row) {
  980. // this.$router.push({
  981. // name: "stockInDetail",
  982. // query: { id: row.id, type: this.type }
  983. // });
  984. this.$router.push({path:"/stock/in/order/edit?id="+row.id})
  985. },
  986. handleDelete: function(index, row) {
  987. const ids = [];
  988. ids.push(row.id);
  989. const idStr = ids.join(",");
  990. const params = {
  991. ids: idStr
  992. };
  993. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  994. confirmButtonText: "确定",
  995. cancelButtonText: "取消",
  996. type: "warning"
  997. })
  998. .then(() => {
  999. deleteWarehouseInfo(params).then(response => {
  1000. if (response.data.state == 0) {
  1001. this.$message.error(response.data.msg);
  1002. return false;
  1003. } else {
  1004. this.$notify({
  1005. title: "成功",
  1006. message: "删除成功",
  1007. type: "success",
  1008. duration: 2000
  1009. });
  1010. for (let i = 0; i < ids.length; i++) {
  1011. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  1012. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  1013. this.Warehouse.warehouseDate.splice(y, 1);
  1014. }
  1015. }
  1016. }
  1017. }
  1018. });
  1019. })
  1020. .catch(() => {});
  1021. },
  1022. changeAllSelected: function(val) {
  1023. if (val) {
  1024. this.$refs.multipleTable.toggleAllSelection();
  1025. } else {
  1026. this.$refs.multipleTable.clearSelection();
  1027. }
  1028. },
  1029. select(selection) {
  1030. this.order_id = selection[0].id
  1031. console.log("selection",selection)
  1032. this.selectedTableData = selection;
  1033. },
  1034. batchDelete() {
  1035. if (this.selectedTableData.length <= 0) {
  1036. this.$message.error("请选择要删除的记录");
  1037. return;
  1038. }
  1039. const ids = [];
  1040. for (let i = 0; i < this.selectedTableData.length; i++) {
  1041. ids.push(this.selectedTableData[i].id);
  1042. }
  1043. const idStr = ids.join(",");
  1044. const params = {
  1045. ids: idStr
  1046. };
  1047. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  1048. confirmButtonText: "确定",
  1049. cancelButtonText: "取消",
  1050. type: "warning"
  1051. })
  1052. .then(() => {
  1053. deleteWarehouseInfo(params).then(response => {
  1054. if (response.data.state == 0) {
  1055. this.$message.error(response.data.msg);
  1056. return false;
  1057. } else {
  1058. this.$notify({
  1059. title: "成功",
  1060. message: "删除成功",
  1061. type: "success",
  1062. duration: 2000
  1063. });
  1064. for (let i = 0; i < ids.length; i++) {
  1065. for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
  1066. if (ids[i] == this.Warehouse.warehouseDate[y].id) {
  1067. this.Warehouse.warehouseDate.splice(y, 1);
  1068. }
  1069. }
  1070. }
  1071. }
  1072. });
  1073. })
  1074. .catch(() => {});
  1075. },
  1076. // handleSearch(id){
  1077. // this.WarehouseInfo.warehouseInfoDate = [];
  1078. // this.GetOrderDetail(id)
  1079. // this.drug_id = id
  1080. // this.dialogVisible = true
  1081. // },
  1082. handleSearch(val){
  1083. this.tableList= []
  1084. this.GetOrderDetail(val.id)
  1085. this.drug_id = val.id
  1086. },
  1087. GetOrderDetail: function(id) {
  1088. const params = {
  1089. id: id
  1090. };
  1091. getWarehouseInfoList(params).then(response => {
  1092. if (response.data.state == 0) {
  1093. this.$message.error(response.data.msg);
  1094. return false;
  1095. } else {
  1096. this.tableShow = true
  1097. for (let i = 0; i < response.data.data.info.length; i++) {
  1098. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  1099. // response.data.data.info[i].product_date = this.getTime(response.data.data.info[i].product_date,"{y}-{m}-{d}");
  1100. // response.data.data.info[i].expiry_date = this.getTime(response.data.data.info[i].expiry_date,"{y}-{m}-{d}");
  1101. response.data.data.info[i].price = response.data.data.info[i].price.toString();
  1102. response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
  1103. this.recordInfo.recordData.push(response.data.data.info[i]);
  1104. this.tableList.push(response.data.data.info[i])
  1105. console.log("详情",this.tableList)
  1106. }
  1107. this.warehouse = response.data.data.warehousing;
  1108. this.warehousing_time = this.getTime(this.warehouse.warehousing_time,"{y}-{m}-{d}");
  1109. console.log("单据日期",this.warehousing_time)
  1110. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  1111. }
  1112. });
  1113. },
  1114. editRecord: function() {
  1115. this.editDialogVisible = true
  1116. },
  1117. deleteRecord: function() {
  1118. const ids = [];
  1119. ids.push(this.WarehouseInfo.warehouse.id);
  1120. const idStr = ids.join(",");
  1121. const params = {
  1122. ids: idStr
  1123. };
  1124. this.$confirm("确认删除入库单记录?", "删除入库单记录", {
  1125. confirmButtonText: "确定",
  1126. cancelButtonText: "取消",
  1127. type: "warning"
  1128. })
  1129. .then(() => {
  1130. deleteWarehouseInfo(params).then(response => {
  1131. if (response.data.state == 0) {
  1132. this.$message.error(response.data.msg);
  1133. return false;
  1134. } else {
  1135. this.$notify({
  1136. title: "成功",
  1137. message: "删除成功",
  1138. type: "success",
  1139. duration: 2000
  1140. });
  1141. this.$router.back(-1);
  1142. }
  1143. });
  1144. })
  1145. .catch(() => {});
  1146. },
  1147. typeName: function(good_type_id) {
  1148. let name = "";
  1149. for (let i = 0; i < this.goodType.length; i++) {
  1150. if (this.goodType[i].id == good_type_id) {
  1151. name = this.goodType[i].type_name;
  1152. }
  1153. }
  1154. return name;
  1155. },
  1156. showDialog(index, row) {
  1157. this.currentIndex = index;
  1158. const params = {
  1159. manufacturer_id: this.form.manufacturer,
  1160. dealer_id: this.form.dealer
  1161. };
  1162. this.propForm.goods = []
  1163. GetAllGoodInfoByID(params).then(response => {
  1164. if (response.data.state == 0) {
  1165. this.$message.error(response.data.msg);
  1166. return false;
  1167. } else {
  1168. if (response.data.data.goodInfo.length <= 0) {
  1169. this.$message.error("该厂商或经销商没有物品信息");
  1170. return;
  1171. }
  1172. this.$refs.dialog.show();
  1173. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  1174. this.propForm.goodType.push(
  1175. response.data.data.goodInfo[i].type
  1176. );
  1177. }
  1178. const obj = {};
  1179. this.propForm.goodType = this.propForm.goodType.reduce(
  1180. (cur, next) => {
  1181. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  1182. return cur;
  1183. },
  1184. []
  1185. ); // 设置cur默认类型为数组,并且初始值为空的数组
  1186. }
  1187. for (let i = 0; i < this.propForm.goodType.length; i++) {
  1188. let goodInfo = [];
  1189. let goodObj = {};
  1190. for (let a = 0; a < response.data.data.goodInfo.length; a++) {
  1191. var respObj = response.data.data.goodInfo[a];
  1192. respObj["isSelected"] = false;
  1193. if (respObj.type.id == this.propForm.goodType[i].id) {
  1194. goodInfo.push(respObj);
  1195. }
  1196. }
  1197. const obj = {};
  1198. goodInfo = goodInfo.reduce((cur, next) => {
  1199. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  1200. return cur;
  1201. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  1202. this.$set(goodObj, this.propForm.goodType[i].id, goodInfo);
  1203. this.propForm.goods.push(goodObj);
  1204. }
  1205. });
  1206. },
  1207. specificationName: function(drug_id) {
  1208. let name = "";
  1209. for (let i = 0; i < this.goodInfo.length; i++) {
  1210. if (this.goodInfo[i].id == drug_id) {
  1211. name = this.goodInfo[i].specification_name;
  1212. }
  1213. }
  1214. return name;
  1215. },
  1216. submit() {
  1217. this.$refs["tableForm"].validate(valid => {
  1218. if (valid) {
  1219. const array = this.recordInfo.recordData;
  1220. console.log('array',array)
  1221. for (let i = 0; i < array.length; i++) {
  1222. if (array[i].good_type_id == 0) {
  1223. this.$message.error("商品类型不能为空");
  1224. return;
  1225. }
  1226. if (array[i].good_id == 0) {
  1227. this.$message.error("规格名称不能为空");
  1228. return;
  1229. }
  1230. }
  1231. const params = {
  1232. stockIn: this.recordInfo.recordData
  1233. };
  1234. EditWarehouse(
  1235. params,
  1236. this.warehousing_time,
  1237. this.drug_id,
  1238. this.type,
  1239. this.form.manufacturer,
  1240. this.form.dealer
  1241. ).then(response => {
  1242. if (response.data.state == 0) {
  1243. this.$message.error(response.data.msg);
  1244. return false;
  1245. } else {
  1246. this.$message.success("入库成功");
  1247. this.dialogVisible = false
  1248. this.editDialogVisible = false
  1249. }
  1250. });
  1251. } else {
  1252. return false;
  1253. }
  1254. });
  1255. },
  1256. changeManufacturer(val) {
  1257. },
  1258. changeDealer(val) {
  1259. },
  1260. DeleteWarehouseInfoItem: function(index, row) {
  1261. if (row.id == 0) {
  1262. this.recordInfo.recordData.splice(index, 1);
  1263. } else {
  1264. const params = {
  1265. id: row.id
  1266. };
  1267. this.$confirm("确认删除该入库商品信息记录?", "删除入库商品信息记录", {
  1268. confirmButtonText: "确定",
  1269. cancelButtonText: "取消",
  1270. type: "warning"
  1271. })
  1272. .then(() => {
  1273. DeleteWarehouseInfoItem(params).then(response => {
  1274. if (response.data.state == 0) {
  1275. this.$message.error(response.data.msg);
  1276. return false;
  1277. } else {
  1278. this.$message.success("删除成功");
  1279. this.recordInfo.recordData.splice(index, 1);
  1280. }
  1281. });
  1282. })
  1283. .catch(() => {});
  1284. }
  1285. },
  1286. handleEditTwo: function(index, row) {
  1287. const tempObj = {};
  1288. tempObj["id"] = 0;
  1289. tempObj["good_type_id"] = 0;
  1290. tempObj["good_id"] = 0;
  1291. tempObj["number"] = "";
  1292. tempObj["product_date"] = "";
  1293. tempObj["expiry_date"] = "";
  1294. tempObj["warehousing_count"] = "";
  1295. tempObj["price"] = "";
  1296. tempObj["remark"] = "";
  1297. tempObj["dealer"] = "";
  1298. tempObj["manufacturer"] = "";
  1299. this.recordInfo.recordData.push(tempObj);
  1300. },
  1301. comfirm: function(val) {
  1302. this.$refs.dialog.hide();
  1303. this.propForm.goodType = [];
  1304. this.propForm.goods = [];
  1305. if (val.selectedGoodInfo.length > 0) {
  1306. for (let i = val.selectedGoodInfo.length - 1; ; i--) {
  1307. if (i == 0) {
  1308. this.recordInfo.recordData[this.currentIndex].good_type_id =
  1309. val.selectedGoodInfo[i].good_type_id;
  1310. this.recordInfo.recordData[this.currentIndex].good_id =
  1311. val.selectedGoodInfo[i].id;
  1312. this.recordInfo.recordData[
  1313. this.currentIndex
  1314. ].price = val.selectedGoodInfo[i].buy_price.toString();
  1315. } else {
  1316. const tempForm = {};
  1317. tempForm["id"] = 0;
  1318. tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
  1319. tempForm["good_id"] = val.selectedGoodInfo[i].id;
  1320. tempForm["number"] = "";
  1321. tempForm["product_date"] = "";
  1322. tempForm["expiry_date"] = "";
  1323. tempForm["warehousing_count"] = "";
  1324. tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
  1325. tempForm["remark"] = "";
  1326. tempForm["dealer"] = "";
  1327. tempForm["manufacturer"] = "";
  1328. this.recordInfo.recordData.splice(
  1329. this.currentIndex + 1,
  1330. 0,
  1331. tempForm
  1332. );
  1333. }
  1334. }
  1335. }
  1336. this.currentIndex = -1;
  1337. },
  1338. cancle: function() {
  1339. this.$refs.dialog.hide();
  1340. this.propForm.goods = [];
  1341. this.propForm.goodType = [];
  1342. },
  1343. toPrint(){
  1344. if(this.order_id == 0){
  1345. this.$message.error("请勾选入库单")
  1346. }else{
  1347. this.$router.push("/stock/in/detail/print?id="+this.order_id)
  1348. }
  1349. }
  1350. }
  1351. };
  1352. </script>
  1353. <style rel="stylesheet/css" lang="scss" scoped>
  1354. .information {
  1355. border: 1px #dcdfe6 solid;
  1356. padding: 30px 20px 30px 20px;
  1357. .border {
  1358. border-bottom: 1px #dcdfe6 solid;
  1359. margin: 0px 0 20px 0;
  1360. }
  1361. }
  1362. .edit_separater {
  1363. border-top: 1px solid rgb(233, 233, 233);
  1364. margin-top: 15px;
  1365. margin-bottom: 15px;
  1366. }
  1367. </style>
  1368. <style>
  1369. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1370. font-size: 12px;
  1371. }
  1372. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1373. background: #6fb5fa;
  1374. }
  1375. .count {
  1376. color: #bd2c00;
  1377. }
  1378. .el-table td,
  1379. .el-table th.is-leaf,
  1380. .el-table--border,
  1381. .el-table--group {
  1382. border-color: #d0d3da;
  1383. }
  1384. .el-table--border::after,
  1385. .el-table--group::after,
  1386. .el-table::before {
  1387. background-color: #d0d3da;
  1388. }
  1389. </style>