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

cancelStockOrderEdit.vue 27KB

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