detailsPage.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList(0)"
  6. >返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button
  11. class="el-button&#45;&#45;small-yh"
  12. type="success"
  13. size="small"
  14. v-if="form.whetherShippingNotice == 0 && paymentType == 1"
  15. @click="notice"
  16. >微信发货通知
  17. </el-button>
  18. <el-button v-if="editButton" class="el-button&#45;&#45;small-yh" type="primary" size="small" @click="confirmEditing">编辑 </el-button>
  19. <el-button v-else class="el-button--small-yh" type="primary" size="small" :disabled="editDisabled" @click="editCustomer">保存数据 </el-button>
  20. <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '已出库'" @click="revoke">撤销出库 </el-button>
  21. <el-button
  22. class="el-button--small-yh"
  23. type="success"
  24. size="small"
  25. style="margin-left: 6px;"
  26. v-if="form.statusName == '待出库' || form.statusName == '撤销出库'"
  27. @click="complete"
  28. :disabled="isSave"
  29. >出库完成
  30. </el-button>
  31. </div>
  32. </div>
  33. <div style="margin-top: 50px">
  34. <trade-card title="基础信息">
  35. <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
  36. </trade-card>
  37. <trade-card title="明细信息">
  38. <el-tabs v-model="activeName" type="card">
  39. <el-tab-pane label="出库明细" name="sale_detail">
  40. <avue-crud
  41. :option="optionContacts"
  42. v-model="formContacts"
  43. ref="formContacts"
  44. :data="form.shipItemsList"
  45. @row-save="rowSave"
  46. @row-update="rowUpdate"
  47. @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)"
  48. @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)"
  49. >
  50. <template slot-scope="scope" slot="menuLeft">
  51. <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
  52. </template>
  53. <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
  54. <el-popover placement="left" width="500" trigger="hover">
  55. <el-table
  56. :row-style="{ height: '20px', padding: '0px', fontSize: '12px' }"
  57. :cell-style="{ padding: '0px', fontSize: '12px' }"
  58. :data="row.recordList"
  59. :header-cell-style="tableHeaderCellStyle"
  60. border
  61. stripe
  62. height="300px"
  63. style="width: 100%"
  64. >
  65. <el-table-column property="srcOrd" label="单号">
  66. <template slot-scope="{ row }">
  67. <span style="color: #409EFF;cursor: pointer" @click.stop="Jump(row)">{{ row.srcOrd }} </span>
  68. </template>
  69. </el-table-column>
  70. <el-table-column property="num" label="数量"></el-table-column>
  71. <el-table-column property="amount" label="金额"></el-table-column>
  72. <el-table-column property="createUserName" label="制单人"></el-table-column>
  73. <el-table-column property="createTime" label="制单日期"></el-table-column>
  74. </el-table>
  75. <el-button
  76. v-if="row.recordList"
  77. slot="reference"
  78. :size="size"
  79. :disabled="!row.id"
  80. :type="type"
  81. icon="el-icon-view"
  82. style="margin-right: 8px;"
  83. >
  84. 查看记录
  85. </el-button>
  86. </el-popover>
  87. <el-button
  88. v-if="reservoirArea == 1 && row.historyList.length"
  89. :size="size"
  90. :disabled="!row.id || editDisabled"
  91. type="text"
  92. @click="rowDelArea(row, index)"
  93. >
  94. 清空库区
  95. </el-button>
  96. <el-button
  97. v-if="reservoirArea == 1 && row.historyList.length"
  98. :size="size"
  99. :disabled="!row.id"
  100. type="text"
  101. @click="rowArea(row, index)"
  102. >
  103. 查看库区
  104. </el-button>
  105. <el-button
  106. v-if="reservoirArea == 1 && row.historyList.length == 0"
  107. :size="size"
  108. :disabled="!row.id || editDisabled"
  109. type="text"
  110. @click="rowArea(row, index)"
  111. >
  112. 选择库区
  113. </el-button>
  114. <el-button
  115. v-if="reservoirArea != 1"
  116. :size="size"
  117. :disabled="editDisabled"
  118. :type="type"
  119. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  120. @click="rowEdit(row, index)"
  121. >
  122. {{ row.$cellEdit ? "保存" : "编辑" }}
  123. </el-button>
  124. <el-button icon="el-icon-delete" :size="size" :disabled="editDisabled" :type="type" @click="rowDelBox(row, index)">删除 </el-button>
  125. </template>
  126. </avue-crud>
  127. </el-tab-pane>
  128. <el-tab-pane label="订单信息" name="payment_details">
  129. <avue-crud
  130. :option="optionPaymentDetails"
  131. v-model="formContacts"
  132. ref="payment_details"
  133. :data="form.shipVOList"
  134. :key="key"
  135. @row-save="rowSave"
  136. @row-update="rowUpdate"
  137. @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)"
  138. @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)"
  139. >
  140. </avue-crud>
  141. </el-tab-pane>
  142. <el-tab-pane label="历史记录" name="outbound_records">
  143. <avue-crud
  144. :option="optionOutboundRecords"
  145. v-model="formContacts"
  146. ref="outbound_records"
  147. :data="form.historyList"
  148. :key="key"
  149. @row-save="rowSave"
  150. @row-update="rowUpdate"
  151. @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)"
  152. @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)"
  153. >
  154. </avue-crud>
  155. </el-tab-pane>
  156. </el-tabs>
  157. </trade-card>
  158. <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
  159. <containerTitle title="上传附件"></containerTitle>
  160. <c-upload
  161. v-loading="loadingBtn"
  162. typeUpload="LT"
  163. :disabled="editDisabled"
  164. deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
  165. :data="filesList"
  166. display
  167. :enumerationValue="35.1"
  168. ></c-upload>
  169. <report-dialog :switchDialog="switchDialog" :reportId="form.id" @onClose="onClose()"></report-dialog>
  170. </div>
  171. </div>
  172. </template>
  173. <script>
  174. import {
  175. getDetails,
  176. tradingBox,
  177. submit,
  178. warehousingComplete,
  179. revokeOutboundCompleted,
  180. shippingNotice,
  181. itemRemove
  182. } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
  183. import { dateFormat } from "@/util/date";
  184. import reportDialog from "@/components/report-dialog/main";
  185. import { dotList } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
  186. import { getParamservice } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
  187. import { isProcurement } from "@/api/basicData/configuration";
  188. import viewArea from "./components/viewArea.vue";
  189. export default {
  190. name: "detailsPage",
  191. data() {
  192. return {
  193. reservoirArea: 0,
  194. // 上传附件的需要参数
  195. loadingBtn: false,
  196. filesList: [],
  197. itemAreaList: [],
  198. switchDialog: false,
  199. activeName: "sale_detail",
  200. editButton: false,
  201. editDisabled: false,
  202. form: {
  203. shipItemsList: [],
  204. shipVOList: [],
  205. historyList: []
  206. },
  207. key: 0,
  208. optionForm: {
  209. disabled: false,
  210. menuBtn: false,
  211. span: 8,
  212. column: [
  213. {
  214. label: "业务对象",
  215. disabled: true,
  216. prop: "customerId",
  217. type: "select",
  218. props: {
  219. label: "cname",
  220. value: "id"
  221. },
  222. dicUrl: "/api/blade-sales-part/corpsDesc/listAll?corpType=KH&enableOrNot=1",
  223. rules: [
  224. {
  225. required: true,
  226. message: " ",
  227. trigger: "blur"
  228. }
  229. ]
  230. },
  231. {
  232. label: "仓库",
  233. prop: "storageId",
  234. disabled: false,
  235. type: "select",
  236. props: {
  237. label: "cname",
  238. value: "id"
  239. },
  240. dicUrl: "/api/blade-sales-part/storageDesc/listAll",
  241. rules: [
  242. {
  243. required: true,
  244. message: " ",
  245. trigger: "blur"
  246. }
  247. ]
  248. },
  249. {
  250. label: "库管",
  251. prop: "stockClerkId",
  252. type: "select",
  253. disabled: false,
  254. props: {
  255. label: "realName",
  256. value: "id"
  257. },
  258. dicUrl: "/api/blade-user/stockClerkList",
  259. rules: [
  260. {
  261. required: true,
  262. message: " ",
  263. trigger: "blur"
  264. }
  265. ]
  266. },
  267. {
  268. label: "业务日期",
  269. prop: "businesDate",
  270. searchProp: "businesDateList",
  271. disabled: true,
  272. type: "datetime",
  273. value: dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss"),
  274. format: "yyyy-MM-dd HH:mm",
  275. valueFormat: "yyyy-MM-dd HH:mm:ss",
  276. rules: [
  277. {
  278. required: true,
  279. message: "",
  280. trigger: "blur"
  281. }
  282. ]
  283. },
  284. {
  285. label: "出库单号",
  286. disabled: true,
  287. prop: "billno",
  288. rules: [
  289. {
  290. required: true,
  291. message: " ",
  292. trigger: "blur"
  293. }
  294. ]
  295. },
  296. {
  297. label: "来源单号",
  298. prop: "ordNo",
  299. disabled: true
  300. },
  301. {
  302. label: "配送方式",
  303. prop: "shipType",
  304. type: "select",
  305. disabled: false,
  306. props: {
  307. label: "dictValue",
  308. value: "dictKey"
  309. },
  310. dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod"
  311. },
  312. {
  313. label: "货运公司",
  314. prop: "logisticsCorpName",
  315. type: "select",
  316. disabled: false,
  317. props: {
  318. label: "dictValue",
  319. value: "dictKey"
  320. },
  321. dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company"
  322. },
  323. {
  324. label: "货运单号",
  325. prop: "expressNo",
  326. disabled: false
  327. },
  328. {
  329. label: "订单数量",
  330. prop: "goodsTotalNum",
  331. disabled: true,
  332. rules: [
  333. {
  334. required: true,
  335. message: " ",
  336. trigger: "blur"
  337. }
  338. ]
  339. },
  340. {
  341. label: "出库数量",
  342. prop: "sendTotalNum",
  343. disabled: true
  344. },
  345. {
  346. label: "备注",
  347. prop: "remarks",
  348. type: "textarea",
  349. disabled: false,
  350. span: 16,
  351. minRows: 1
  352. }
  353. ]
  354. },
  355. formContacts: {},
  356. optionContacts: {},
  357. optionContactsBack: {
  358. align: "center",
  359. index: true,
  360. updateBtnText: "保存",
  361. refreshBtn: false,
  362. dialogDrag: true,
  363. addBtn: false,
  364. span: 8,
  365. height: 300,
  366. addRowBtn: false,
  367. editBtn: false,
  368. delBtn: false,
  369. menuWidth: 250,
  370. dialogTop: 25,
  371. dialogWidth: "80%",
  372. showSummary: true,
  373. saveBtn: false, // 表格弹窗保存按钮
  374. cellBtn: false, // 行编辑
  375. sumColumnList: [
  376. {
  377. name: "goodsNum",
  378. type: "sum"
  379. },
  380. {
  381. name: "sendNum",
  382. type: "sum"
  383. }
  384. ],
  385. column: [
  386. // {
  387. // label: '商品名称',
  388. // prop: 'goodsId',
  389. // disabled: true,
  390. // width: 200,
  391. // overHidden: true,
  392. // hide: true,
  393. // type: 'select',
  394. // remote: true,
  395. // props: {
  396. // label: 'cname',
  397. // value: 'id'
  398. // },
  399. // dicUrl: '/api/blade-sales-part/goodsDesc/list?current=1&size=10&cname={{key}}&enableOrNot=1'
  400. // },
  401. {
  402. label: "商品名称",
  403. prop: "goodsName",
  404. width: 200,
  405. overHidden: true
  406. },
  407. {
  408. label: "商品编码",
  409. prop: "goodsNo",
  410. width: 100,
  411. overHidden: true
  412. },
  413. {
  414. label: "品牌",
  415. prop: "brandId",
  416. width: 100,
  417. overHidden: true,
  418. type: "select",
  419. props: {
  420. label: "cname",
  421. value: "id"
  422. },
  423. dicUrl: "/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1"
  424. },
  425. {
  426. label: "规格型号",
  427. prop: "propertyName",
  428. width: 100,
  429. overHidden: true
  430. },
  431. {
  432. label: "花纹",
  433. prop: "pattern",
  434. width: 100,
  435. overHidden: true
  436. },
  437. {
  438. label: "商品描述",
  439. prop: "goodsDescription",
  440. overHidden: true
  441. },
  442. {
  443. label: "批次号",
  444. prop: "dot",
  445. cell: true,
  446. type: "select",
  447. overHidden: true,
  448. dicData: [],
  449. props: {
  450. label: "dot",
  451. value: "dot"
  452. },
  453. dicUrl: "/api/blade-sales-part/stockDesc/dotList"
  454. },
  455. {
  456. label: "单位",
  457. prop: "units",
  458. type: "select",
  459. overHidden: true,
  460. props: {
  461. label: "dictValue",
  462. value: "dictValue"
  463. },
  464. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit"
  465. },
  466. {
  467. label: "库存",
  468. prop: "inventory",
  469. overHidden: true
  470. },
  471. {
  472. label: "出库数量",
  473. prop: "goodsNum",
  474. overHidden: true
  475. },
  476. {
  477. label: "发货数量",
  478. prop: "sendNum",
  479. cell: true,
  480. overHidden: true
  481. },
  482. {
  483. label: "备注",
  484. prop: "remarks",
  485. overHidden: true
  486. },
  487. {
  488. label: "自有数",
  489. prop: "sendNumHave",
  490. overHidden: true
  491. },
  492. {
  493. label: "代采数",
  494. prop: "sendNumFinancing",
  495. overHidden: true
  496. }
  497. ]
  498. },
  499. optionPaymentDetails: {},
  500. optionPaymentDetailsBack: {
  501. align: "center",
  502. index: true,
  503. addBtnText: "录入明细",
  504. refreshBtn: false,
  505. dialogDrag: true,
  506. addBtn: false,
  507. span: 8,
  508. height: 600,
  509. addRowBtn: false,
  510. editBtn: false,
  511. delBtn: false,
  512. menuWidth: 140,
  513. dialogTop: 25,
  514. dialogWidth: "80%",
  515. menu: false,
  516. column: [
  517. {
  518. label: "出库单号",
  519. prop: "billno",
  520. overHidden: true
  521. },
  522. {
  523. label: "来源单号",
  524. prop: "ordNo",
  525. overHidden: true
  526. },
  527. {
  528. label: "业务来源",
  529. prop: "bsType",
  530. overHidden: true
  531. },
  532. {
  533. label: "地址",
  534. prop: "recAddress",
  535. overHidden: true
  536. },
  537. {
  538. label: "联系人",
  539. prop: "contacts",
  540. overHidden: true
  541. },
  542. {
  543. label: "电话",
  544. prop: "phone",
  545. overHidden: true
  546. },
  547. {
  548. label: "备注",
  549. prop: "remarks",
  550. overHidden: true
  551. }
  552. ]
  553. },
  554. optionOutboundRecords: {},
  555. optionOutboundRecordsBack: {
  556. align: "center",
  557. index: true,
  558. addBtnText: "录入明细",
  559. refreshBtn: false,
  560. dialogDrag: true,
  561. addBtn: false,
  562. span: 8,
  563. height: 600,
  564. addRowBtn: false,
  565. editBtn: false,
  566. delBtn: false,
  567. menuWidth: 140,
  568. dialogTop: 25,
  569. dialogWidth: "80%",
  570. menu: false,
  571. column: [
  572. {
  573. label: "操作人",
  574. prop: "operatorName",
  575. overHidden: true
  576. },
  577. {
  578. label: "状态",
  579. prop: "operateStatus",
  580. overHidden: true
  581. },
  582. {
  583. label: "时间",
  584. prop: "operateTime",
  585. overHidden: true
  586. }
  587. ]
  588. },
  589. paymentType: null,
  590. whetherFinancing: 0
  591. };
  592. },
  593. components: {
  594. reportDialog,
  595. viewArea
  596. },
  597. props: {
  598. onLoad: Object,
  599. detailData: Object
  600. },
  601. async created() {
  602. this.optionContacts = await this.getColumnData(this.getColumnName(270.1), this.optionContactsBack);
  603. isProcurement({ param: "whether.model" }).then(res => {
  604. if (res.data.data == 1) {
  605. this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
  606. }
  607. });
  608. this.optionPaymentDetails = await this.getColumnData(this.getColumnName(270.2), this.optionPaymentDetailsBack);
  609. this.optionOutboundRecords = await this.getColumnData(this.getColumnName(270.3), this.optionOutboundRecordsBack);
  610. this.key++;
  611. if (this.onLoad.id) {
  612. this.editButton = true;
  613. this.editDisabled = true;
  614. this.optionForm.disabled = true;
  615. this.refresh(this.onLoad.id, true);
  616. }
  617. if (this.detailData.id) {
  618. this.editButton = true;
  619. this.editDisabled = true;
  620. this.optionForm.disabled = true;
  621. this.refresh();
  622. }
  623. if (this.$route.query.srcId) {
  624. this.editButton = true;
  625. this.editDisabled = true;
  626. this.optionForm.disabled = true;
  627. this.refresh(this.$route.query.srcId);
  628. }
  629. this.$store.commit("DOMIO_IN_DETAIL");
  630. getParamservice(1, 10, { paramKey: "WeChat.shipping.notification" }).then(res => {
  631. if (res.data.data.records.length > 0) {
  632. this.paymentType = res.data.data.records[0].paramValue;
  633. }
  634. });
  635. isProcurement({ param: "whether.financing" }).then(res => {
  636. if (res.data.data == 1) {
  637. this.whetherFinancing = res.data.data;
  638. }
  639. });
  640. isProcurement({ param: "reservoir.area" }).then(res => {
  641. this.reservoirArea = res.data.data;
  642. });
  643. },
  644. activated() {
  645. if (this.detailData.id) {
  646. this.refresh();
  647. }
  648. this.$store.commit("DOMIO_IN_DETAIL");
  649. },
  650. methods: {
  651. rowDelArea(row, index) {
  652. if (row.historyList.filter(item => item.id).length) {
  653. this.$confirm("是否撤销库区?", "提示", {
  654. confirmButtonText: "确定",
  655. cancelButtonText: "取消",
  656. type: "warning"
  657. }).then(() => {
  658. let ids = [];
  659. for (let item of row.historyList) {
  660. ids.push(item.id);
  661. }
  662. itemRemove({ ids: ids.join(",") }).then(res => {
  663. row.historyList = [];
  664. row.dot = null;
  665. row.sendNum = 0;
  666. row.inventory = 0;
  667. });
  668. });
  669. } else {
  670. row.historyList = [];
  671. row.dot = null;
  672. row.sendNum = 0;
  673. row.inventory = 0;
  674. }
  675. },
  676. rowArea(row, index) {
  677. // let obj = {
  678. // shipId: this.form.id,
  679. // shipItemId: row.id,
  680. // goodsId: row.goodsId,
  681. // storageId: this.form.storageId,
  682. // dot: row.dot
  683. // };
  684. this.$refs.viewArea.openDialog(this.form, row, index);
  685. },
  686. areaData(row, index) {
  687. console.log(row, index);
  688. this.form.shipItemsList[index].dot = row.dot;
  689. this.form.shipItemsList[index].inventory = row.inventory;
  690. this.form.shipItemsList[index].sendNum = row.sendNum;
  691. this.form.shipItemsList[index].historyList = row.historyList;
  692. },
  693. notice() {
  694. this.$confirm("是否微信发货通知?", "提示", {
  695. confirmButtonText: "确定",
  696. cancelButtonText: "取消",
  697. type: "warning"
  698. }).then(() => {
  699. const loading = this.$loading({
  700. lock: true,
  701. text: "加载中",
  702. spinner: "el-icon-loading",
  703. background: "rgba(255,255,255,0.7)"
  704. });
  705. shippingNotice(this.form)
  706. .then(res => {
  707. this.$message.success("操作成功");
  708. this.refresh(res.data.data.id);
  709. loading.close();
  710. })
  711. .finally(() => {
  712. loading.close();
  713. });
  714. });
  715. },
  716. // 撤销出库
  717. revoke() {
  718. this.$refs["form"].validate((valid, done) => {
  719. done();
  720. if (valid) {
  721. const loading = this.$loading({
  722. lock: true,
  723. text: "加载中",
  724. spinner: "el-icon-loading",
  725. background: "rgba(255,255,255,0.7)"
  726. });
  727. revokeOutboundCompleted({
  728. ...this.form,
  729. bizTypeName: "FHGD"
  730. })
  731. .then(res => {
  732. if (res.data.code === 601) {
  733. this.$message({
  734. type: "error",
  735. message: res.data.msg
  736. });
  737. this.refresh(this.form.id);
  738. } else {
  739. this.$message.success("撤销成功");
  740. this.refresh(this.form.id, true);
  741. }
  742. })
  743. .finally(() => {
  744. loading.close();
  745. });
  746. }
  747. });
  748. },
  749. rowEdit(row, index) {
  750. if (this.form.statusName == "待出库") {
  751. this.optionContacts.column.forEach(its => {
  752. if (its.prop == "dot") {
  753. this.$set(its, "disabled", false);
  754. }
  755. });
  756. }
  757. dotList({
  758. storageId: this.form.storageId,
  759. goodsId: row.goodsId
  760. }).then(res => {
  761. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
  762. // 增加监听数据改变更改库存数量
  763. this.findObject(this.optionContacts.column, "dot").change = data => {
  764. for (let item of data.column.dicData) {
  765. if (item.dot == data.value) {
  766. this.$set(row, "inventory", item.balanceQuantity);
  767. }
  768. }
  769. };
  770. });
  771. if (row.$cellEdit) {
  772. this.$set(row, "$cellEdit", false);
  773. } else {
  774. this.$set(row, "$cellEdit", true);
  775. }
  776. // this.$refs.formContacts.rowEdit(row, index)
  777. },
  778. complete() {
  779. console.log(this.form.id);
  780. this.$refs["form"].validate((valid, done) => {
  781. done();
  782. if (valid) {
  783. if (this.whetherFinancing == 1) {
  784. for (let item of this.form.shipItemsList) {
  785. if (item.historyList.length == 0) {
  786. return this.$message.error("请维护出库明细的库区");
  787. }
  788. }
  789. }
  790. const loading = this.$loading({
  791. lock: true,
  792. text: "加载中",
  793. spinner: "el-icon-loading",
  794. background: "rgba(255,255,255,0.7)"
  795. });
  796. this.form.shipItemsList.forEach(item => {
  797. item.goodsName = item.$goodsId;
  798. });
  799. submit({
  800. ...this.form,
  801. bizTypeName: "FHGD"
  802. })
  803. .then(res => {
  804. if (res.data.code === 601) {
  805. loading.close();
  806. this.$message({
  807. type: "error",
  808. message: res.data.msg
  809. });
  810. this.refresh(this.form.id);
  811. } else {
  812. warehousingComplete({
  813. ...this.form,
  814. bizTypeName: "FHGD"
  815. })
  816. .then(res => {
  817. this.$message.success("出库完成");
  818. this.refresh(res.data.data.id);
  819. })
  820. .finally(() => {
  821. loading.close();
  822. });
  823. }
  824. })
  825. .catch(() => {
  826. loading.close();
  827. });
  828. } else {
  829. this.$message.error("请选择库管");
  830. }
  831. });
  832. },
  833. Jump(row) {
  834. if (this.$store.getters.financingStatus) {
  835. this.$alert("融资采购(L)已存在,请关闭融资采购(L)再进行操作", "温馨提示", {
  836. confirmButtonText: "确定",
  837. type: "warning"
  838. });
  839. } else {
  840. this.$router.$avueRouter.closeTag("/tirePartsMall/purchasingManagement/financingProcurement/index");
  841. this.$router.push({
  842. path: "/tirePartsMall/purchasingManagement/financingProcurement/index",
  843. query: {
  844. srcId: row.srcId
  845. }
  846. });
  847. }
  848. },
  849. //修改提交触发
  850. editCustomer() {
  851. this.$refs["form"].validate((valid, done) => {
  852. done();
  853. if (valid) {
  854. const loading = this.$loading({
  855. lock: true,
  856. text: "加载中",
  857. spinner: "el-icon-loading",
  858. background: "rgba(255,255,255,0.7)"
  859. });
  860. submit({
  861. ...this.form,
  862. bizTypeName: "FHGD",
  863. filesList: this.filesList
  864. })
  865. .then(res => {
  866. if (res.data.code === 601) {
  867. this.$message({
  868. type: "error",
  869. message: res.data.msg
  870. });
  871. this.refresh(this.form.id);
  872. } else {
  873. this.$message.success("保存成功");
  874. this.refresh(res.data.data.id);
  875. }
  876. })
  877. .finally(() => {
  878. loading.close();
  879. });
  880. } else {
  881. return false;
  882. }
  883. });
  884. },
  885. refresh(id, type) {
  886. const loading = this.$loading({
  887. lock: true,
  888. text: "加载中",
  889. spinner: "el-icon-loading",
  890. background: "rgba(255,255,255,0.7)"
  891. });
  892. getDetails({ id: id })
  893. .then(res => {
  894. if (res.data.data.statusName == "已出库") {
  895. this.editDisabled = true;
  896. this.optionForm.disabled = true;
  897. }
  898. if (type && !this.editButton) {
  899. this.editDisabled = false;
  900. this.optionForm.disabled = false;
  901. }
  902. this.form = res.data.data;
  903. this.filesList = res.data.data.filesList;
  904. })
  905. .finally(() => {
  906. loading.close();
  907. });
  908. },
  909. rowDelBox(row, index) {
  910. this.$confirm("确定将选择数据删除?", {
  911. confirmButtonText: "确定",
  912. cancelButtonText: "取消",
  913. type: "warning"
  914. }).then(() => {
  915. if (row.id) {
  916. tradingBox(row.id).then(res => {
  917. this.form.shipItemsList.splice(index, 1);
  918. this.$message.success("操作成功!");
  919. });
  920. } else {
  921. this.form.shipItemsList.splice(index, 1);
  922. this.$message.success("操作成功!");
  923. }
  924. });
  925. },
  926. rowSave(form, done, loading) {
  927. done(form);
  928. },
  929. rowUpdate(form, index, done, loading) {
  930. done(form);
  931. },
  932. //打印
  933. handlePrint() {
  934. this.switchDialog = !this.switchDialog;
  935. },
  936. onClose(val) {
  937. this.switchDialog = val;
  938. },
  939. //编辑
  940. confirmEditing() {
  941. this.editButton = false;
  942. if (this.form.statusName == "待出库" || this.form.statusName == "撤销出库") {
  943. this.editDisabled = false;
  944. this.optionForm.disabled = false;
  945. }
  946. if (this.form.statusName == "已出库") {
  947. this.editDisabled = true;
  948. this.optionForm.disabled = true;
  949. }
  950. },
  951. //自定义列保存
  952. async saveColumnTwo(ref, option, optionBack, code) {
  953. /**
  954. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  955. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  956. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  957. */
  958. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  959. isProcurement({ param: "whether.model" }).then(res => {
  960. if (res.data.data == 1) {
  961. this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
  962. }
  963. });
  964. if (inSave) {
  965. this.$message.success("保存成功");
  966. //关闭窗口
  967. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  968. }
  969. },
  970. //自定义列重置
  971. async resetColumnTwo(ref, option, optionBack, code) {
  972. this[option] = this[optionBack];
  973. isProcurement({ param: "whether.model" }).then(res => {
  974. if (res.data.data == 1) {
  975. this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
  976. }
  977. });
  978. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  979. if (inSave) {
  980. this.$message.success("重置成功");
  981. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  982. }
  983. },
  984. backToList(type) {
  985. this.$emit("backToList", type);
  986. // this.$store.commit("DOMIO_OUT_DETAIL");
  987. },
  988. // 表头样式
  989. tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
  990. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;textAlign:center";
  991. }
  992. }
  993. };
  994. </script>
  995. <style lang="scss" scoped>
  996. ::v-deep .el-form-item {
  997. margin-bottom: 8px !important;
  998. }
  999. </style>