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

cancelStockOrderEdit.vue 28KB

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