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

stockInOrderAdd.vue 28KB

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