stockInOrderEdit.vue 25KB

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