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

stockInOrderEdit.vue 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  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="true"
  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 +" " + item.specification_name + " "+ item.manufacturer}}</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. oninput="value=value.replace(/\D|^0/g,'')"
  188. placeholder="请输入入库数量"
  189. type="number"
  190. v-model="scope.row.warehousing_count"
  191. ></el-input>
  192. {{scope.row.min_unit}}
  193. </el-form-item>
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="总价" align="center" width="80">
  197. <template slot-scope="scope">
  198. {{ calculate(scope.row.price * scope.row.warehousing_count) }}
  199. </template>
  200. </el-table-column>
  201. <el-table-column label="生产厂家" align="center" width="150">
  202. <template slot-scope="scope">
  203. <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
  204. <el-option
  205. v-for="(option, index) in manufacturerList"
  206. :key="index"
  207. :label="option.manufacturer_name"
  208. :value="option.id">
  209. </el-option>
  210. </el-select>
  211. </template>
  212. </el-table-column>
  213. <el-table-column align="center" width="150">
  214. <template slot="header" slot-scope="scope">
  215. <span>批号</span>
  216. </template>
  217. <template slot-scope="scope">
  218. <el-form-item style="padding-top: 20px">
  219. <el-input
  220. placeholder="请输入批号"
  221. v-model="scope.row.number"
  222. ></el-input>
  223. </el-form-item>
  224. </template>
  225. </el-table-column>
  226. <el-table-column label="生产日期" width="180" align="center">
  227. <template slot-scope="scope">
  228. <el-date-picker
  229. prefix-icon="el-icon-date"
  230. style="width: 145px"
  231. v-model="scope.row.product_date"
  232. type="date"
  233. placeholder="选择日期时间"
  234. format="yyyy-MM-dd"
  235. value-format="yyyy-MM-dd"
  236. ></el-date-picker>
  237. </template>
  238. </el-table-column>
  239. <el-table-column label="有效日期" width="180" align="center">
  240. <template slot-scope="scope">
  241. <el-date-picker
  242. prefix-icon="el-icon-date"
  243. style="width: 145px"
  244. v-model="scope.row.expiry_date"
  245. type="date"
  246. placeholder="选择日期时间"
  247. format="yyyy-MM-dd"
  248. value-format="yyyy-MM-dd"
  249. ></el-date-picker>
  250. </template>
  251. </el-table-column>
  252. <el-table-column align="center" width="150">
  253. <template slot="header" slot-scope="scope">
  254. <span>批准文号</span>
  255. </template>
  256. <template slot-scope="scope">
  257. <el-form-item style="padding-top: 20px">
  258. <el-input
  259. placeholder="请输入批准文号"
  260. v-model="scope.row.license_number"
  261. ></el-input>
  262. </el-form-item>
  263. </template>
  264. </el-table-column>
  265. <el-table-column label="经销商" align="center" width="150">
  266. <template slot-scope="scope">
  267. <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商">
  268. <el-option
  269. v-for="(option, index) in dealerList"
  270. :key="index"
  271. :label="option.dealer_name"
  272. :value="option.id">
  273. </el-option>
  274. </el-select>
  275. </template>
  276. </el-table-column>
  277. <el-table-column label="备注" width="150" align="center">
  278. <template slot-scope="scope">
  279. <el-input v-model="scope.row.remark"></el-input>
  280. </template>
  281. </el-table-column>
  282. <el-table-column
  283. label="操作"
  284. fixed="right"
  285. align="center"
  286. width="150"
  287. >
  288. <template slot-scope="scope">
  289. <el-tooltip
  290. class="item"
  291. effect="dark"
  292. content="新增"
  293. placement="top"
  294. >
  295. <el-button
  296. size="mini"
  297. type="primary"
  298. icon="el-icon-circle-plus-outline"
  299. @click="handleEdit(scope.$index, scope.row)"
  300. >
  301. </el-button>
  302. </el-tooltip>
  303. <el-tooltip
  304. class="item"
  305. effect="dark"
  306. content="删除"
  307. placement="top"
  308. >
  309. <el-button
  310. size="mini"
  311. type="danger"
  312. icon="el-icon-delete"
  313. @click="handleDelete(scope.$index, scope.row)"
  314. >
  315. </el-button>
  316. </el-tooltip>
  317. </template>
  318. </el-table-column>
  319. </el-table>
  320. </el-form>
  321. </div>
  322. </div>
  323. </template>
  324. <script>
  325. import stockInDialog from "./Dialog/stockInDialog";
  326. import { uParseTime } from "@/utils/tools";
  327. import {
  328. GetAllConfig,
  329. getWarehouseInfoList,
  330. GetAllGoodInfoByID,
  331. DeleteWarehouseInfoItem,
  332. EditWarehouse,
  333. postSearchGoodList
  334. } from "@/api/stock";
  335. import BreadCrumb from "../components/bread-crumb";
  336. export default {
  337. components: { BreadCrumb, stockInDialog },
  338. name: "stockIn",
  339. data() {
  340. var checkGoodId = (rule, value, callback) => {
  341. setTimeout(() => {
  342. if (value == "" || value == 0) {
  343. return callback(new Error("规格名称不能为空"));
  344. }
  345. }, 2000);
  346. };
  347. return {
  348. crumbs: [
  349. { path: false, name: "库存管理" },
  350. { path: false, name: "耗材入库单" },
  351. { path: false, name: "编辑入库单" }
  352. ],
  353. crumbs2: [
  354. { path: false, name: "库存管理" },
  355. { path: false, name: "其他入库单" },
  356. { path: false, name: "编辑入库单" }
  357. ],
  358. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  359. warehousing_time: "",
  360. adminUserOptions: null,
  361. currentIndex: 0,
  362. recordInfo: {
  363. recordData: [],
  364. stock_in_code: "",
  365. current_index: ""
  366. },
  367. tableRules: {
  368. price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
  369. warehousing_count: [
  370. { required: true, message: "数量不能为空", trigge: "blur" }
  371. ],
  372. good_id: [{ validator: checkGoodId, trigger: "blur" }]
  373. },
  374. total: "",
  375. product_date: "",
  376. expiry_date: "",
  377. numbers: "",
  378. // prop
  379. isVisibility: false,
  380. propForm: {
  381. goods: [],
  382. goodType: [],
  383. goodInfo: [],
  384. goodUnit: [],
  385. title: "入库",
  386. isCreated: 1
  387. },
  388. form: {
  389. manufacturer: "",
  390. dealer: ""
  391. },
  392. warehouse: {},
  393. manufacturer: [],
  394. dealerList: [],
  395. goodType: [],
  396. manufacturerList:[],
  397. numberList:[]
  398. };
  399. },
  400. methods: {
  401. comfirm: function(val) {
  402. this.$refs.dialog.hide();
  403. this.propForm.goodType = [];
  404. this.propForm.goods = [];
  405. if (val.selectedGoodInfo.length > 0) {
  406. for (let i = val.selectedGoodInfo.length - 1; ; i--) {
  407. if (i == 0) {
  408. this.recordInfo.recordData[this.currentIndex].good_type_id =
  409. val.selectedGoodInfo[i].good_type_id;
  410. this.recordInfo.recordData[this.currentIndex].good_id =
  411. val.selectedGoodInfo[i].id;
  412. this.recordInfo.recordData[
  413. this.currentIndex
  414. ].price = val.selectedGoodInfo[i].buy_price.toString();
  415. } else {
  416. const tempForm = {};
  417. tempForm["id"] = 0;
  418. tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
  419. tempForm["good_id"] = val.selectedGoodInfo[i].id;
  420. tempForm["number"] = "";
  421. tempForm["product_date"] = "";
  422. tempForm["expiry_date"] = "";
  423. tempForm["warehousing_count"] = "";
  424. tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
  425. tempForm["remark"] = "";
  426. tempForm["dealer"] = "";
  427. tempForm["manufacturer"] = "";
  428. this.recordInfo.recordData.splice(
  429. this.currentIndex + 1,
  430. 0,
  431. tempForm
  432. );
  433. }
  434. }
  435. }
  436. this.currentIndex = -1;
  437. },
  438. cancle: function() {
  439. this.$refs.dialog.hide();
  440. this.propForm.goods = [];
  441. this.propForm.goodType = [];
  442. },
  443. GetConfigInfo: function() {
  444. const loading = this.$loading({
  445. lock: true,
  446. text: "Loading",
  447. spinner: "el-icon-loading",
  448. background: "rgba(0, 0, 0, 0.7)"
  449. });
  450. GetAllConfig().then(response => {
  451. if (response.data.state == 0) {
  452. this.$message.error(response.data.msg);
  453. return false;
  454. } else {
  455. this.manufacturer = response.data.data.manufacturer;
  456. this.manufacturerList = response.data.data.manufacturer
  457. this.dealerList = response.data.data.dealer
  458. this.dealer = response.data.data.dealer;
  459. this.goodType = response.data.data.goodType;
  460. this.goodInfo = response.data.data.goodInfo;
  461. // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
  462. // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
  463. }
  464. loading.close();
  465. });
  466. },
  467. typeName: function(good_type_id) {
  468. let name = "";
  469. for (let i = 0; i < this.goodType.length; i++) {
  470. if (this.goodType[i].id == good_type_id) {
  471. name = this.goodType[i].type_name;
  472. }
  473. }
  474. return name;
  475. },
  476. specificationName: function(good_info_id) {
  477. let name = "";
  478. for (let i = 0; i < this.goodInfo.length; i++) {
  479. if (this.goodInfo[i].id == good_info_id) {
  480. name = this.goodInfo[i].specification_name;
  481. }
  482. }
  483. return name;
  484. },
  485. handleEdit: function(index, row) {
  486. const tempObj = {};
  487. tempObj["id"] = 0;
  488. tempObj["good_type_id"] = 0;
  489. tempObj["good_id"] = 0;
  490. tempObj["number"] = "";
  491. tempObj["product_date"] = "";
  492. tempObj["expiry_date"] = "";
  493. tempObj["warehousing_count"] = "";
  494. tempObj["price"] = "";
  495. tempObj["remark"] = "";
  496. tempObj["dealer"] = "";
  497. tempObj["manufacturer"] = "";
  498. tempObj["license_number"] = ""
  499. this.recordInfo.recordData.push(tempObj);
  500. },
  501. handleDelete: function(index, row) {
  502. if (row.id == 0) {
  503. this.recordInfo.recordData.splice(index, 1);
  504. } else {
  505. const params = {
  506. id: row.id
  507. };
  508. this.$confirm("确认删除该入库商品信息记录?", "删除入库商品信息记录", {
  509. confirmButtonText: "确定",
  510. cancelButtonText: "取消",
  511. type: "warning"
  512. })
  513. .then(() => {
  514. DeleteWarehouseInfoItem(params).then(response => {
  515. if (response.data.state == 0) {
  516. this.$message.error(response.data.msg);
  517. return false;
  518. } else {
  519. this.$message.success("删除成功");
  520. this.recordInfo.recordData.splice(index, 1);
  521. }
  522. });
  523. })
  524. .catch(() => {});
  525. }
  526. },
  527. calculate: function(val) {
  528. if (val == 0) {
  529. return "";
  530. }
  531. return Math.round(parseFloat(val) * 100) / 100;
  532. },
  533. getTime(val, temp) {
  534. if (val != 0) {
  535. return uParseTime(val, temp);
  536. } else {
  537. return "";
  538. }
  539. },
  540. showDialog(index, row) {
  541. this.currentIndex = index;
  542. const loading = this.$loading({
  543. lock: true,
  544. text: "Loading",
  545. spinner: "el-icon-loading",
  546. background: "rgba(0, 0, 0, 0.7)"
  547. });
  548. const params = {
  549. manufacturer_id: this.form.manufacturer,
  550. dealer_id: this.form.dealer
  551. };
  552. this.propForm.goods = []
  553. GetAllGoodInfoByID(params).then(response => {
  554. if (response.data.state == 0) {
  555. this.$message.error(response.data.msg);
  556. return false;
  557. } else {
  558. if (response.data.data.goodInfo.length <= 0) {
  559. this.$message.error("该厂商或经销商没有物品信息");
  560. return;
  561. }
  562. this.$refs.dialog.show();
  563. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  564. this.propForm.goodType.push(
  565. response.data.data.goodInfo[i].type
  566. );
  567. }
  568. const obj = {};
  569. this.propForm.goodType = this.propForm.goodType.reduce(
  570. (cur, next) => {
  571. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  572. return cur;
  573. },
  574. []
  575. ); // 设置cur默认类型为数组,并且初始值为空的数组
  576. }
  577. for (let i = 0; i < this.propForm.goodType.length; i++) {
  578. let goodInfo = [];
  579. let goodObj = {};
  580. for (let a = 0; a < response.data.data.goodInfo.length; a++) {
  581. var respObj = response.data.data.goodInfo[a];
  582. respObj["isSelected"] = false;
  583. if (respObj.type.id == this.propForm.goodType[i].id) {
  584. goodInfo.push(respObj);
  585. }
  586. }
  587. const obj = {};
  588. goodInfo = goodInfo.reduce((cur, next) => {
  589. obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
  590. return cur;
  591. }, []); // 设置cur默认类型为数组,并且初始值为空的数组
  592. this.$set(goodObj, this.propForm.goodType[i].id, goodInfo);
  593. this.propForm.goods.push(goodObj);
  594. }
  595. loading.close();
  596. });
  597. },
  598. back() {
  599. this.$router.go(-1);
  600. },
  601. submit() {
  602. this.$refs["tableForm"].validate(valid => {
  603. if (valid) {
  604. const array = this.recordInfo.recordData;
  605. for (let i = 0; i < array.length; i++) {
  606. if (array[i].good_type_id == 0) {
  607. this.$message.error("商品类型不能为空");
  608. return;
  609. }
  610. if (array[i].good_id == 0) {
  611. this.$message.error("规格名称不能为空");
  612. return;
  613. }
  614. }
  615. for(let i=0;i<this.recordInfo.recordData.length;i++){
  616. this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
  617. if(this.recordInfo.recordData[i].dealer == ""){
  618. this.recordInfo.recordData[i].dealer = 0
  619. }
  620. for(let j=0;j<this.manufacturerList.length;j++){
  621. if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
  622. this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
  623. }
  624. }
  625. for(let z=0;z<this.dealerList.length;z++){
  626. if(this.recordInfo.recordData[i].dealer == this.dealerList[z].dealer_name){
  627. this.recordInfo.recordData[i].dealer = this.dealerList[z].id
  628. }
  629. }
  630. }
  631. const params = {
  632. stockIn: this.recordInfo.recordData
  633. };
  634. console.log("params2222",params)
  635. EditWarehouse(
  636. params,
  637. this.warehousing_time,
  638. this.$route.query.id,
  639. this.$route.query.type,
  640. this.form.manufacturer,
  641. this.form.dealer
  642. ).then(response => {
  643. if (response.data.state == 0) {
  644. this.$message.error(response.data.msg);
  645. return false;
  646. } else {
  647. this.$message.success("入库成功");
  648. this.$router.back(-1);
  649. }
  650. });
  651. } else {
  652. return false;
  653. }
  654. });
  655. },
  656. GetOrderDetail: function(order_id) {
  657. const params = {
  658. id: order_id
  659. };
  660. console.log("parm2222222222",params)
  661. getWarehouseInfoList(params).then(response => {
  662. if (response.data.state == 0) {
  663. this.$message.error(response.data.msg);
  664. return false;
  665. } else {
  666. console.log("列表2222222",response.data.data.info)
  667. for (let i = 0; i < response.data.data.info.length; i++) {
  668. response.data.data.info[i].product_date = this.getTime(
  669. response.data.data.info[i].product_date,
  670. "{y}-{m}-{d}"
  671. );
  672. response.data.data.info[i].expiry_date = this.getTime(
  673. response.data.data.info[i].expiry_date,
  674. "{y}-{m}-{d}"
  675. );
  676. response.data.data.info[i].price = response.data.data.info[i].price.toString();
  677. response.data.data.info[i].warehousing_count = response.data.data.info[i].warehousing_count.toString();
  678. response.data.data.info[i].good_name = response.data.data.info[i].GoodInfo.good_name
  679. response.data.data.info[i].name = response.data.data.info[i].GoodInfo.specification_name + "/"+response.data.data.info[i].GoodInfo.packing_unit
  680. response.data.data.info[i].packing_unit = response.data.data.info[i].GoodInfo.packing_unit
  681. if(response.data.data.info[i].manufacturer == 0){
  682. response.data.data.manufacturer = ""
  683. }
  684. if(response.data.data.info[i].dealer == 0){
  685. response.data.data.info[i].dealer = ""
  686. }
  687. this.recordInfo.recordData.push(response.data.data.info[i]);
  688. console.log("列表",this.recordInfo.recordData)
  689. }
  690. this.warehouse = response.data.data.warehousing;
  691. console.log("jhhahfhh",this.warehouse)
  692. this.warehousing_time = this.getTime(
  693. this.warehouse[0].warehousing_time,
  694. "{y}-{m}-{d}"
  695. );
  696. if (this.recordInfo.recordData.length == 0) {
  697. const tempObj = {};
  698. tempObj["id"] = 0;
  699. tempObj["good_type_id"] = 0;
  700. tempObj["good_id"] = 0;
  701. tempObj["number"] = "";
  702. tempObj["product_date"] = "";
  703. tempObj["expiry_date"] = "";
  704. tempObj["warehousing_count"] = "";
  705. tempObj["price"] = "";
  706. tempObj["remark"] = "";
  707. tempObj["dealer"] = "";
  708. tempObj["manufacturer"] = "";
  709. tempObj["license_number"] = ""
  710. this.recordInfo.recordData.push(tempObj);
  711. }
  712. }
  713. });
  714. },
  715. querySearchAsync(keyword, cb) {
  716. let key = '';
  717. if (keyword != undefined) {
  718. key = keyword
  719. }
  720. postSearchGoodList(key).then(response => {
  721. if (response.data.state == 1) {
  722. var list = response.data.data.list
  723. this.goodList = list
  724. var manufacturerList = response.data.data.manufacturerList
  725. this.manufacturerList = manufacturerList
  726. this.dealerList = response.data.data.dealerList
  727. for(let i=0;i<this.goodList.length;i++){
  728. for(let j=0;j<manufacturerList.length;j++){
  729. if(this.goodList[i].manufacturer == manufacturerList[j].id){
  730. this.goodList[i].manufacturer = manufacturerList[j].manufacturer_name
  731. }
  732. }
  733. }
  734. for(let i=0;i<this.goodList.length;i++){
  735. for(let j=0;j<this.dealerList.length;j++){
  736. if(this.goodList[i].dealer == this.dealerList[j].id){
  737. this.goodList[i].dealer = this.dealerList[j].dealer_name
  738. }
  739. }
  740. }
  741. cb(this.goodList)
  742. } else {
  743. cb([])
  744. }
  745. })
  746. },
  747. changeGoodName(val){
  748. this.currentIndex = val
  749. },
  750. handleSelect(val){
  751. for(let i=0;i<this.recordInfo.recordData.length;i++){
  752. if(this.currentIndex == i){
  753. this.recordInfo.recordData[i].good_type_id = val.id
  754. this.recordInfo.recordData[i].good_name = val.good_name
  755. this.recordInfo.recordData[i].good_type_id = val.good_type_id
  756. this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
  757. this.recordInfo.recordData[i].number = val.number
  758. this.recordInfo.recordData[i].manufacturer = val.manufacturer
  759. this.recordInfo.recordData[i].remark = val.remark
  760. if(val.buy_price == 0){
  761. this.recordInfo.recordData[i].price= ""
  762. }else{
  763. this.recordInfo.recordData[i].price = val.buy_price
  764. }
  765. this.recordInfo.recordData[i].specification_name = val.specification_name
  766. this.recordInfo.recordData[i].good_id = val.id
  767. this.recordInfo.recordData[i].packing_unit = val.packing_unit
  768. if(val.dealer == 0){
  769. this.recordInfo.recordData[i].dealer
  770. }else{
  771. this.recordInfo.recordData[i].dealer = val.dealer
  772. }
  773. }
  774. }
  775. }
  776. },
  777. created() {
  778. this.GetConfigInfo();
  779. this.propForm.goodUnit = this.$store.getters.good_unit;
  780. const order_id = this.$route.query.id;
  781. this.GetOrderDetail(order_id);
  782. }
  783. };
  784. </script>
  785. <style>
  786. #oictable ::-webkit-scrollbar {
  787. height: 15px;
  788. }
  789. </style>
  790. <style rel="stylesheet/css" lang="scss" scoped>
  791. .information {
  792. border: 1px #dcdfe6 solid;
  793. padding: 30px 20px 30px 20px;
  794. .border {
  795. border-bottom: 1px #dcdfe6 solid;
  796. margin: 0px 0 20px 0;
  797. }
  798. }
  799. .edit_separater {
  800. border-top: 1px solid rgb(233, 233, 233);
  801. margin-top: 15px;
  802. margin-bottom: 15px;
  803. }
  804. </style>
  805. <style>
  806. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  807. font-size: 12px;
  808. }
  809. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  810. background: #6fb5fa;
  811. }
  812. </style>