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

stockOutOrderEdit.vue 29KB

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