stockOutOrderAdd.vue 26KB

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