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

stockInOrderAdd.vue 27KB

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