stockInOrder.vue 46KB

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