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

stockInOrderEdit.vue 28KB

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