detailsPage.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435
  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 class="el-button&#45;&#45;small-yh" type="primary" size="small" v-if="editButton" @click="confirmEditing">编辑 </el-button>
  11. <el-button v-else class="el-button--small-yh" type="primary" size="small" @click="editCustomer" :disabled="editDisabled">保存数据 </el-button>
  12. <el-button
  13. class="el-button--small-yh"
  14. type="warning"
  15. size="small"
  16. v-if="form.statusName == '确认调拨'"
  17. @click="revoke"
  18. :disabled=" form.status == '是'"
  19. >撤销调拨
  20. </el-button>
  21. <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;" v-else @click="complete" :disabled="editDisabled"
  22. >确认调拨
  23. </el-button>
  24. <el-button
  25. v-if="form.statusName == '确认调拨' && form.status == '否'"
  26. class="el-button--small-yh"
  27. type="info"
  28. size="small"
  29. style="margin-left: 6px;"
  30. @click="confirmComplete"
  31. :disabled="form.status == '是'"
  32. >已出仓
  33. </el-button>
  34. </div>
  35. </div>
  36. <div style="margin-top: 50px">
  37. <trade-card title="基础信息">
  38. <avue-form :option="optionForm" v-model="form" ref="form">
  39. <template slot="storageName">
  40. <dic-select
  41. v-model="form.storageName"
  42. placeholder="调出仓库"
  43. label="cname"
  44. res="records"
  45. :disabled="editDisabled || form.shipItemsList.length"
  46. url="/blade-sales-part/storageDesc/list?current=1&size=5"
  47. :filterable="true"
  48. :remote="true"
  49. dataName="cname"
  50. @selectChange="dicChange('storageName', $event)"
  51. ></dic-select>
  52. </template>
  53. <template slot="callInStorageName">
  54. <dic-select
  55. v-model="form.callInStorageName"
  56. placeholder="调入仓库"
  57. label="cname"
  58. res="records"
  59. :disabled="editDisabled || form.shipItemsList.length"
  60. url="/blade-sales-part/storageDesc/list?current=1&size=5"
  61. :filterable="true"
  62. :remote="true"
  63. dataName="cname"
  64. @selectChange="dicChange('callInStorageName', $event)"
  65. ></dic-select>
  66. </template>
  67. </avue-form>
  68. </trade-card>
  69. <trade-card title="明细信息">
  70. <avue-crud
  71. :option="optionContacts"
  72. v-model="formContacts"
  73. ref="formContacts"
  74. :data="form.shipItemsList"
  75. :key="key"
  76. @row-save="rowSave"
  77. @row-update="rowUpdate"
  78. @selection-change="selectionContacts"
  79. @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 430)"
  80. @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 430)"
  81. >
  82. <template slot-scope="{ scope, row }" slot="menuLeft">
  83. <el-button type="primary" icon="el-icon-printer" size="small" @click="adddiailsfun" :disabled="editDisabled">录入明细</el-button>
  84. <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
  85. <el-popover width="800" trigger="click" placement="right">
  86. <avue-crud :data="inventoryData" :option="inventoryOption">
  87. <template slot-scope="{ row }" slot="menu">
  88. <el-button
  89. type="text"
  90. icon="el-icon-refresh"
  91. size="small"
  92. :disabled="row.storageId != form.storageId || editDisabled"
  93. @click.stop="synchronous(row)"
  94. >更新库存
  95. </el-button>
  96. </template>
  97. </avue-crud>
  98. <el-button
  99. type="primary"
  100. plain
  101. size="small"
  102. slot="reference"
  103. @click="viewInventory"
  104. :disabled="selectionMultilist.length != 1 || editDisabled"
  105. >同步库存</el-button
  106. >
  107. </el-popover>
  108. </template>
  109. <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
  110. <el-button
  111. v-if="reservoirArea == 1 && row.historyList.length"
  112. :size="size"
  113. :disabled="!row.id || editDisabled"
  114. type="text"
  115. @click="rowDelArea(row, index)"
  116. >
  117. 清空库区
  118. </el-button>
  119. <el-button v-if="reservoirArea == 1 && row.historyList.length" :size="size" :disabled="!row.id" type="text" @click="rowArea(row, index)">
  120. 查看库区
  121. </el-button>
  122. <el-button
  123. v-if="reservoirArea == 1 && row.historyList.length == 0"
  124. :size="size"
  125. :disabled="!row.id || editDisabled"
  126. type="text"
  127. @click="rowArea(row, index)"
  128. >
  129. 选择库区
  130. </el-button>
  131. <el-button
  132. v-if="reservoirArea != 1"
  133. :size="size"
  134. :disabled="editDisabled"
  135. :type="type"
  136. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  137. @click="rowEdit(row, index)"
  138. >
  139. {{ row.$cellEdit ? "保存" : "编辑" }}
  140. </el-button>
  141. <el-button icon="el-icon-delete" :size="size" :disabled="editDisabled" :type="type" @click="rowDelBox(row, index)">删除 </el-button>
  142. </template>
  143. <template slot="goodsNum" slot-scope="{ row }">
  144. <el-input-number
  145. v-if="row.$cellEdit && whetherFinancing != 1"
  146. v-model="row.goodsNum"
  147. size="small"
  148. :controls="false"
  149. :precision="0"
  150. style="width: 100%"
  151. @change="calculator2(row)"
  152. />
  153. <span v-else>{{ row.goodsNum }}</span>
  154. </template>
  155. <template slot="sendNumFinancing" slot-scope="{ row }">
  156. <el-input-number
  157. v-if="row.$cellEdit"
  158. v-model="row.sendNumFinancing"
  159. size="small"
  160. :controls="false"
  161. :precision="0"
  162. style="width: 100%"
  163. @change="calculator(row)"
  164. />
  165. <span v-else>{{ row.sendNumFinancing }}</span>
  166. </template>
  167. <template slot="sendNumHave" slot-scope="{ row }">
  168. <el-input-number
  169. v-if="row.$cellEdit"
  170. v-model="row.sendNumHave"
  171. size="small"
  172. :controls="false"
  173. :precision="0"
  174. style="width: 100%"
  175. @change="calculator(row)"
  176. />
  177. <span v-else>{{ row.sendNumHave }}</span>
  178. </template>
  179. <template slot="dot" slot-scope="{ row }">
  180. <!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
  181. <!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
  182. <!--无需使用鼠标或键盘方向键进行定位。-->
  183. <!--allow-create filterable default-first-option-->
  184. <el-select
  185. v-if="row.$cellEdit"
  186. v-model="row.dot"
  187. size="small"
  188. filterable
  189. default-first-option
  190. @focus="picihaolistfun(row.goodsId)"
  191. @change="picihaolistChangefun($event, row)"
  192. >
  193. <el-option v-for="(item, index) in picihaolist" :key="index" :label="item.dot" :value="item.dot"></el-option>
  194. </el-select>
  195. <span v-else>{{ row.dot }}</span>
  196. </template>
  197. <template slot="price" slot-scope="{ row }">
  198. <el-input-number v-if="row.$cellEdit" v-model="row.price" size="small" :controls="false" style="width: 100%" @change="calculator2(row)" />
  199. <span v-else>{{ row.price }}</span>
  200. </template>
  201. </avue-crud>
  202. </trade-card>
  203. <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
  204. <containerTitle title="上传附件"></containerTitle>
  205. <c-upload
  206. v-loading="loadingBtn"
  207. typeUpload="LT"
  208. :disabled="editDisabled"
  209. deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
  210. :data="filesList"
  211. display
  212. :enumerationValue="35.1"
  213. ></c-upload>
  214. <report-dialog :switchDialog="switchDialog" :reportId="form.id" @onClose="onClose()"></report-dialog>
  215. <dialogAssembly ref="dialogAssemblyRef" :form="form" @tableDataHandle="tableDataHandle"> </dialogAssembly>
  216. </div>
  217. </div>
  218. </template>
  219. <script>
  220. import {
  221. getDetails,
  222. tradingBox,
  223. transferAllocateSubmit,
  224. confirmTransferAllocate,
  225. revokeTransferAllocate,
  226. itemRemove,
  227. confirmComplete
  228. } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
  229. import { dateFormat } from "@/util/date";
  230. import reportDialog from "@/components/report-dialog/main";
  231. import { dotList } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
  232. import { isProcurement } from "@/api/basicData/configuration";
  233. import dialogAssembly from "@/views/tirePartsMall/salesManagement/outboundWorkOrderL/dialogAssembly.vue";
  234. import { getKh } from "@/api/tirePartsMall/salesManagement/saleOrder";
  235. import { getList as inventoryList } from "@/api/tirePartsMall/inventory";
  236. import viewArea from "./components/viewArea.vue";
  237. import dicSelect from "@/components/dicSelect/main";
  238. export default {
  239. name: "detailsPage",
  240. data() {
  241. return {
  242. reservoirArea: 0,
  243. selectionMultilist: [],
  244. inventoryData: [],
  245. inventoryOption: {
  246. header: false,
  247. menu: true,
  248. menuWidth: 90,
  249. editBtn: false,
  250. delBtn: false,
  251. column: [
  252. {
  253. label: "商品名称",
  254. prop: "cname",
  255. overHidden: true
  256. },
  257. {
  258. label: "仓库",
  259. prop: "storageName",
  260. overHidden: true
  261. },
  262. {
  263. label: "结余数量",
  264. prop: "balanceQuantity",
  265. overHidden: true
  266. },
  267. {
  268. label: "结余数量(融资)",
  269. prop: "balanceQuantityFinancing",
  270. overHidden: true
  271. },
  272. {
  273. label: "结余数量(自有)",
  274. prop: "balanceQuantityHave",
  275. overHidden: true
  276. },
  277. {
  278. label: "批次号",
  279. prop: "dot",
  280. overHidden: true
  281. }
  282. ]
  283. },
  284. whetherFinancing: 0,
  285. picihaolist: [], // 批次号数据
  286. tableData: [],
  287. // 上传附件的需要参数
  288. loadingBtn: false,
  289. filesList: [],
  290. switchDialog: false,
  291. activeName: "sale_detail",
  292. editButton: false,
  293. editDisabled: false,
  294. form: {
  295. shipItemsList: [],
  296. shipVOList: [],
  297. historyList: []
  298. },
  299. key: 0,
  300. optionForm: {
  301. disabled: false,
  302. menuBtn: false,
  303. span: 8,
  304. column: [
  305. {
  306. label: "调出仓库",
  307. prop: "storageName",
  308. disabled: false,
  309. // type: "select",
  310. // props: {
  311. // label: "cname",
  312. // value: "id"
  313. // },
  314. // dicUrl: "/api/blade-sales-part/storageDesc/listAll",
  315. rules: [
  316. {
  317. required: true,
  318. message: " ",
  319. trigger: "blur"
  320. }
  321. ]
  322. },
  323. {
  324. label: "调入仓库",
  325. prop: "callInStorageName",
  326. disabled: false,
  327. // type: "select",
  328. // props: {
  329. // label: "cname",
  330. // value: "id"
  331. // },
  332. // dicUrl: "/api/blade-sales-part/storageDesc/listAll",
  333. rules: [
  334. {
  335. required: true,
  336. message: " ",
  337. trigger: "blur"
  338. }
  339. ]
  340. },
  341. {
  342. label: "库管",
  343. prop: "stockClerkId",
  344. type: "select",
  345. disabled: false,
  346. props: {
  347. label: "realName",
  348. value: "id"
  349. },
  350. dicUrl: "/api/blade-user/stockClerkList",
  351. rules: [
  352. {
  353. required: true,
  354. message: " ",
  355. trigger: "blur"
  356. }
  357. ]
  358. },
  359. {
  360. label: "业务日期",
  361. prop: "businesDate",
  362. searchProp: "businesDateList",
  363. disabled: false,
  364. type: "datetime",
  365. value: dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss"),
  366. format: "yyyy-MM-dd HH:mm",
  367. valueFormat: "yyyy-MM-dd HH:mm:ss",
  368. rules: [
  369. {
  370. required: true,
  371. message: "",
  372. trigger: "blur"
  373. }
  374. ]
  375. },
  376. {
  377. label: "调拨单号",
  378. prop: "billno",
  379. disabled: true
  380. },
  381. {
  382. label: "调拨数量",
  383. prop: "goodsTotalNum",
  384. disabled: true
  385. },
  386. {
  387. label: "备注",
  388. prop: "remarks",
  389. type: "textarea",
  390. disabled: false,
  391. span: 24,
  392. minRows: 1
  393. }
  394. ]
  395. },
  396. formContacts: {},
  397. optionContacts: {},
  398. optionContactsBack: {
  399. align: "center",
  400. index: true,
  401. updateBtnText: "保存",
  402. refreshBtn: false,
  403. dialogDrag: true,
  404. addBtn: false,
  405. span: 8,
  406. height: 300,
  407. addRowBtn: false,
  408. editBtn: false,
  409. delBtn: false,
  410. menuWidth: 250,
  411. dialogTop: 25,
  412. dialogWidth: "80%",
  413. showSummary: true,
  414. tip: false,
  415. selection: true,
  416. sumColumnList: [
  417. {
  418. name: "goodsNum",
  419. type: "sum"
  420. },
  421. {
  422. name: "sendNum",
  423. type: "sum"
  424. }
  425. ],
  426. column: [
  427. {
  428. label: "商品名称",
  429. prop: "goodsName",
  430. width: 200,
  431. overHidden: true,
  432. hide: false
  433. },
  434. {
  435. label: "商品编码",
  436. disabled: true,
  437. prop: "goodsNo",
  438. overHidden: true,
  439. width: 100
  440. },
  441. {
  442. label: "批次号",
  443. prop: "dot",
  444. overHidden: true,
  445. width: 160,
  446. type: "select",
  447. // disabled: 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: "inventory",
  458. overHidden: true,
  459. disabled: true
  460. },
  461. {
  462. label: "参考库存融资",
  463. prop: "inventoryFinancing",
  464. overHidden: true,
  465. width: 120,
  466. disabled: true,
  467. hide: true,
  468. showColumn: false
  469. },
  470. {
  471. label: "参考库存自有",
  472. prop: "inventoryHave",
  473. overHidden: true,
  474. width: 120,
  475. disabled: true,
  476. hide: true,
  477. showColumn: false
  478. },
  479. {
  480. label: "调拨数量",
  481. prop: "goodsNum",
  482. overHidden: true,
  483. disabled: false
  484. },
  485. {
  486. label: "调拨融资",
  487. prop: "sendNumFinancing",
  488. overHidden: true,
  489. disabled: false,
  490. hide: true,
  491. showColumn: false
  492. },
  493. {
  494. label: "调拨自有",
  495. prop: "sendNumHave",
  496. overHidden: true,
  497. disabled: false,
  498. hide: true,
  499. showColumn: false
  500. },
  501. {
  502. label: "单价",
  503. prop: "price",
  504. overHidden: true,
  505. disabled: true
  506. },
  507. {
  508. label: "品牌",
  509. prop: "brandName",
  510. disabled: false,
  511. width: 100,
  512. overHidden: true
  513. },
  514. {
  515. label: "规格型号",
  516. prop: "propertyName",
  517. overHidden: true,
  518. disabled: true,
  519. width: 100
  520. },
  521. {
  522. label: "花纹",
  523. prop: "pattern",
  524. overHidden: true,
  525. disabled: true,
  526. width: 100
  527. },
  528. {
  529. label: "商品描述",
  530. prop: "goodsDescription",
  531. overHidden: true,
  532. disabled: true
  533. },
  534. {
  535. label: "单位",
  536. prop: "units",
  537. overHidden: true,
  538. type: "select",
  539. disabled: true,
  540. props: {
  541. label: "dictValue",
  542. value: "dictValue"
  543. },
  544. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit"
  545. },
  546. {
  547. label: "备注",
  548. prop: "remarks",
  549. overHidden: true
  550. }
  551. ]
  552. },
  553. optionContactsBack2: {
  554. disabled: false,
  555. border: true,
  556. align: "center",
  557. index: true,
  558. addBtnText: "添加商品",
  559. updateBtnText: "保存",
  560. refreshBtn: false,
  561. dialogDrag: true,
  562. addBtn: false,
  563. span: 8,
  564. height: 500,
  565. // 添加
  566. addRowBtn: false,
  567. // 保存按钮
  568. editBtn: false,
  569. // 航编辑开启
  570. cellBtn: true,
  571. rowKey: "ids",
  572. delBtn: false,
  573. menuWidth: 140,
  574. dialogTop: 25,
  575. dialogWidth: "80%",
  576. summaryText: this.$t("land118n.total"),
  577. showSummary: true,
  578. selection: true,
  579. sumColumnList: [
  580. {
  581. name: "goodsNum",
  582. type: "sum"
  583. },
  584. {
  585. name: "price",
  586. type: "sum",
  587. decimals: 2
  588. },
  589. {
  590. name: "sendNum",
  591. type: "sum",
  592. decimals: 2
  593. },
  594. {
  595. name: "outGoodsTotalShipNum",
  596. type: "sum",
  597. decimals: 2
  598. },
  599. {
  600. name: "outGoodsTotalShipAmount",
  601. type: "sum",
  602. decimals: 2
  603. },
  604. {
  605. name: "subTotalMoney",
  606. type: "sum",
  607. decimals: 2
  608. },
  609. {
  610. name: "returnsNumber",
  611. type: "sum"
  612. },
  613. {
  614. name: "returnsAmount",
  615. type: "sum"
  616. },
  617. {
  618. name: "primaryGoodsTotalNum",
  619. type: "sum"
  620. },
  621. {
  622. name: "inventory",
  623. type: "sum"
  624. },
  625. {
  626. name: "rebatePrice",
  627. type: "sum",
  628. decimals: 2
  629. },
  630. {
  631. name: "rebateCostprie",
  632. type: "sum",
  633. decimals: 2
  634. },
  635. {
  636. name: "rebateProfit",
  637. type: "sum",
  638. decimals: 2
  639. },
  640. {
  641. name: "primaryGoodsTotalAmount",
  642. type: "sum",
  643. decimals: 2
  644. }
  645. ],
  646. column: [
  647. {
  648. label: "商品名称",
  649. prop: "goodsId",
  650. width: 200,
  651. disabled: false,
  652. remote: true,
  653. hide: true,
  654. overHidden: true,
  655. type: "select",
  656. // dicData: [],
  657. props: {
  658. label: "cname",
  659. value: "id"
  660. },
  661. // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
  662. dicUrl: "/api/blade-sales-part/goodsDesc/list?current=1&size=10&cname={{key}}&enableOrNot=1"
  663. // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
  664. },
  665. {
  666. label: "商品名称",
  667. prop: "goodsName",
  668. width: 200,
  669. disabled: false,
  670. remote: true,
  671. overHidden: true
  672. },
  673. {
  674. label: "数量",
  675. prop: "goodsNum",
  676. overHidden: true,
  677. disabled: false,
  678. cell: true,
  679. width: 100,
  680. rules: [
  681. {
  682. required: true,
  683. message: " ",
  684. trigger: "blur"
  685. },
  686. {
  687. validator: (rule, value, callback) => {
  688. console.log(this.formContacts.inventory);
  689. if (value < 0) {
  690. callback(new Error("数量不能小于0"));
  691. } else {
  692. callback();
  693. }
  694. },
  695. trigger: "blur"
  696. }
  697. ]
  698. },
  699. {
  700. label: "价格",
  701. prop: "price",
  702. overHidden: true,
  703. width: 100,
  704. disabled: false,
  705. cell: true,
  706. rules: [
  707. {
  708. required: true,
  709. message: " ",
  710. trigger: "blur"
  711. },
  712. {
  713. validator: (rule, value, callback) => {
  714. if (value < 0) {
  715. callback(new Error("价格不能小于0"));
  716. } else {
  717. callback();
  718. }
  719. },
  720. trigger: "blur"
  721. }
  722. ]
  723. },
  724. {
  725. label: "库存",
  726. prop: "inventory",
  727. overHidden: true,
  728. width: 100
  729. },
  730. {
  731. label: "批次号",
  732. prop: "dot",
  733. cell: true,
  734. width: 120,
  735. type: "select",
  736. disabled: true,
  737. allowCreate: true,
  738. filterable: true,
  739. dicData: [],
  740. props: {
  741. label: "dot",
  742. value: "dot"
  743. },
  744. dicUrl: "/api/blade-sales-part/stockDesc/dotList",
  745. overHidden: true
  746. },
  747. {
  748. label: "小计",
  749. prop: "subTotalMoney",
  750. overHidden: true,
  751. width: 100,
  752. disabled: true,
  753. editDisplay: false,
  754. addDisplay: false
  755. },
  756. {
  757. label: "商品编码",
  758. prop: "goodsNo",
  759. overHidden: true,
  760. disabled: false,
  761. width: 100
  762. },
  763. {
  764. label: "品牌",
  765. prop: "brandName",
  766. disabled: false,
  767. width: 100,
  768. overHidden: true
  769. },
  770. {
  771. label: "规格型号",
  772. prop: "propertyName",
  773. overHidden: true,
  774. disabled: false,
  775. width: 100
  776. },
  777. {
  778. label: "花纹",
  779. prop: "pattern",
  780. overHidden: true,
  781. disabled: false,
  782. width: 100
  783. },
  784. {
  785. label: "商品描述",
  786. prop: "goodsDescription",
  787. disabled: false,
  788. overHidden: true,
  789. width: 100
  790. },
  791. {
  792. label: "单位",
  793. prop: "units",
  794. type: "select",
  795. disabled: false,
  796. props: {
  797. label: "dictValue",
  798. value: "dictValue"
  799. },
  800. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  801. overHidden: true,
  802. width: 100
  803. },
  804. {
  805. label: "订单数量",
  806. prop: "primaryGoodsTotalNum",
  807. overHidden: true,
  808. width: 100,
  809. disabled: true,
  810. editDisplay: false,
  811. addDisplay: false
  812. },
  813. {
  814. label: "订单金额",
  815. prop: "primaryGoodsTotalAmount",
  816. overHidden: true,
  817. width: 100,
  818. disabled: true,
  819. editDisplay: false,
  820. addDisplay: false
  821. },
  822. {
  823. label: "入库数量",
  824. prop: "sendNum",
  825. overHidden: true,
  826. width: 100,
  827. disabled: true,
  828. editDisplay: false,
  829. addDisplay: false
  830. },
  831. {
  832. label: "出库数量",
  833. prop: "outGoodsTotalShipNum",
  834. overHidden: true,
  835. width: 100,
  836. disabled: true,
  837. editDisplay: false,
  838. addDisplay: false
  839. },
  840. {
  841. label: "出库金额",
  842. prop: "outGoodsTotalShipAmount",
  843. overHidden: true,
  844. width: 100,
  845. disabled: true,
  846. editDisplay: false,
  847. addDisplay: false
  848. },
  849. {
  850. label: "原始数量",
  851. prop: "primaryGoodsTotalNum",
  852. overHidden: true,
  853. width: 100,
  854. disabled: true,
  855. editDisplay: false,
  856. addDisplay: false
  857. },
  858. {
  859. label: "原始金额",
  860. prop: "primaryGoodsTotalAmount",
  861. overHidden: true,
  862. width: 100,
  863. disabled: true,
  864. editDisplay: false,
  865. addDisplay: false
  866. },
  867. {
  868. label: "返利后单价",
  869. prop: "rebatePrice",
  870. overHidden: true,
  871. width: 100,
  872. cell: true
  873. },
  874. {
  875. label: "返利后成本价",
  876. prop: "rebateCostprie",
  877. overHidden: true,
  878. width: 100,
  879. disabled: true,
  880. editDisplay: false,
  881. addDisplay: false
  882. },
  883. {
  884. label: "返利后利润",
  885. prop: "rebateProfit",
  886. overHidden: true,
  887. width: 100,
  888. disabled: true,
  889. editDisplay: false,
  890. addDisplay: false
  891. },
  892. // {
  893. // label: '退货数量',
  894. // prop: "returnsNumber",
  895. // overHidden: true,
  896. // width: 100,
  897. // disabled: true,
  898. // },
  899. // {
  900. // label: '退货金额',
  901. // prop: "returnsAmount",
  902. // overHidden: true,
  903. // width: 100,
  904. // disabled: true,
  905. // },
  906. // {
  907. // label: '利润',
  908. // prop: 'profit',
  909. // overHidden: true,
  910. // width: 100
  911. // },
  912. // {
  913. // label: '返利',
  914. // prop: 'thisAmount',
  915. // overHidden: true,
  916. // width: 100
  917. // },
  918. // {
  919. // label: '成本',
  920. // prop: 'costprie',
  921. // overHidden: true,
  922. // width: 100,
  923. // disabled: true,
  924. // editDisplay: false,
  925. // addDisplay: false
  926. // },
  927. // {
  928. // label: '毛利',
  929. // prop: 'grossProfit',
  930. // overHidden: true,
  931. // width: 100,
  932. // disabled: true,
  933. // editDisplay: false,
  934. // addDisplay: false
  935. // },
  936. {
  937. label: "备注",
  938. prop: "remarks",
  939. overHidden: true,
  940. width: 100,
  941. disabled: false
  942. }
  943. ]
  944. }
  945. };
  946. },
  947. components: {
  948. reportDialog,
  949. dialogAssembly,
  950. viewArea,
  951. dicSelect
  952. },
  953. props: {
  954. onLoad: Object,
  955. detailData: Object
  956. },
  957. async created() {
  958. this.optionContacts = await this.getColumnData(this.getColumnName(430), this.optionContactsBack);
  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. isProcurement({ param: "whether.financing" }).then(res => {
  965. if (res.data.data == 1) {
  966. this.whetherFinancing = res.data.data;
  967. this.findObject(this.optionContacts.column, "inventoryFinancing").hide = false;
  968. this.findObject(this.optionContacts.column, "inventoryFinancing").showColumn = true;
  969. this.findObject(this.optionContacts.column, "inventoryHave").hide = false;
  970. this.findObject(this.optionContacts.column, "inventoryHave").showColumn = true;
  971. this.findObject(this.optionContacts.column, "sendNumFinancing").hide = false;
  972. this.findObject(this.optionContacts.column, "sendNumFinancing").showColumn = true;
  973. this.findObject(this.optionContacts.column, "sendNumHave").hide = false;
  974. this.findObject(this.optionContacts.column, "sendNumHave").showColumn = true;
  975. }
  976. });
  977. isProcurement({ param: "reservoir.area" }).then(res => {
  978. this.reservoirArea = res.data.data;
  979. });
  980. this.key++;
  981. if (this.detailData.id) {
  982. this.editButton = true;
  983. this.editDisabled = true;
  984. this.optionForm.disabled = true;
  985. this.refresh(this.detailData.id);
  986. }
  987. this.$store.commit("DOMIO_IN_ALLOCATW");
  988. },
  989. methods: {
  990. dicChange(name, row) {
  991. if (name == "storageName") {
  992. if (row) {
  993. this.form.storageId = row.id;
  994. } else {
  995. this.form.storageId = null;
  996. this.form.storageName = row.id;
  997. }
  998. }
  999. if (name == "callInStorageName") {
  1000. if (row) {
  1001. this.form.callInStorageId = row.id;
  1002. this.form.remarks = row.remarks;
  1003. } else {
  1004. this.form.callInStorageId = null;
  1005. this.form.callInStorageName = row.id;
  1006. }
  1007. }
  1008. },
  1009. rowDelArea(row, index) {
  1010. if (row.historyList.filter(item => item.id).length) {
  1011. this.$confirm("是否撤销库区?", "提示", {
  1012. confirmButtonText: "确定",
  1013. cancelButtonText: "取消",
  1014. type: "warning"
  1015. }).then(() => {
  1016. let ids = [];
  1017. for (let item of row.historyList) {
  1018. ids.push(item.id);
  1019. }
  1020. itemRemove({ ids: ids.join(",") }).then(res => {
  1021. row.historyList = [];
  1022. row.dot = null;
  1023. row.sendNum = 0;
  1024. row.sendNumFinancing = 0;
  1025. row.sendNumHave = 0;
  1026. });
  1027. });
  1028. } else {
  1029. row.historyList = [];
  1030. row.dot = null;
  1031. row.sendNum = 0;
  1032. row.sendNumFinancing = 0;
  1033. row.sendNumHave = 0;
  1034. }
  1035. },
  1036. rowArea(row, index) {
  1037. this.$refs.viewArea.openDialog(this.form, row, index);
  1038. },
  1039. areaData(row, index) {
  1040. this.form.shipItemsList[index].dot = row.dot;
  1041. this.form.shipItemsList[index].goodsNum = row.sendNum;
  1042. this.form.shipItemsList[index].sendNumFinancing = row.sendNumFinancing;
  1043. this.form.shipItemsList[index].sendNumHave = row.sendNumHave;
  1044. this.form.shipItemsList[index].historyList = row.historyList;
  1045. this.form.shipItemsList[index].inventory = row.inventory;
  1046. this.form.shipItemsList[index].inventoryFinancing = row.inventoryFinancing;
  1047. this.form.shipItemsList[index].inventoryHave = row.inventoryHave;
  1048. },
  1049. viewInventory() {
  1050. inventoryList({
  1051. cname: this.selectionMultilist[0].goodsName,
  1052. dot: this.selectionMultilist[0].dot,
  1053. storageId: this.form.storageId
  1054. }).then(res => [(this.inventoryData = res.data.data.records)]);
  1055. },
  1056. synchronous(row) {
  1057. this.form.shipItemsList.forEach(e => {
  1058. if (e.goodsName == this.selectionMultilist[0].goodsName) {
  1059. e.inventory = row.balanceQuantity;
  1060. e.inventoryFinancing = row.balanceQuantityFinancing;
  1061. e.inventoryHave = row.balanceQuantityHave;
  1062. }
  1063. });
  1064. },
  1065. selectionContacts(list) {
  1066. this.selectionMultilist = list;
  1067. },
  1068. // 撤销调拨
  1069. revoke() {
  1070. this.$refs["form"].validate((valid, done) => {
  1071. done();
  1072. if (valid) {
  1073. const loading = this.$loading({
  1074. lock: true,
  1075. text: "加载中",
  1076. spinner: "el-icon-loading",
  1077. background: "rgba(255,255,255,0.7)"
  1078. });
  1079. revokeTransferAllocate({
  1080. ...this.form,
  1081. bizTypeName: "DBGD"
  1082. })
  1083. .then(res => {
  1084. this.$message.success("撤销成功");
  1085. this.refresh(this.form.id, true);
  1086. })
  1087. .finally(() => {
  1088. loading.close();
  1089. });
  1090. }
  1091. });
  1092. },
  1093. confirmComplete() {
  1094. this.$confirm("调拨单是否确认完成?", "提示", {
  1095. confirmButtonText: "确定",
  1096. cancelButtonText: "取消",
  1097. type: "warning"
  1098. }).then(() => {
  1099. const loading = this.$loading({
  1100. lock: true,
  1101. text: "加载中",
  1102. spinner: "el-icon-loading",
  1103. background: "rgba(255,255,255,0.7)"
  1104. });
  1105. confirmComplete({
  1106. ...this.form,
  1107. bizTypeName: "DBGD"
  1108. })
  1109. .then(res => {
  1110. this.$message.success("撤销成功");
  1111. this.refresh(this.form.id);
  1112. })
  1113. .finally(() => {
  1114. loading.close();
  1115. });
  1116. });
  1117. },
  1118. rowEdit(row, index) {
  1119. this.$set(row, "$cellEdit", !row.$cellEdit);
  1120. // if (this.form.statusName == '录入') {
  1121. // this.optionContactsBack.column.forEach(its => {
  1122. // if (its.prop == 'dot') {
  1123. // this.$set(its, 'disabled', false)
  1124. // }
  1125. // })
  1126. // }
  1127. // console.log('this.formContacts.goodsId', this.formContacts.goodsId);
  1128. // dotList({
  1129. // storageId: this.form.storageId,
  1130. // goodsId: row.goodsId
  1131. // }).then(res => {
  1132. // this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data
  1133. // })
  1134. // this.$refs.formContacts.rowEdit(row, index)
  1135. },
  1136. // 批次号获取数据
  1137. picihaolistfun(goodsId) {
  1138. dotList({
  1139. storageId: this.form.storageId,
  1140. goodsId: goodsId
  1141. }).then(res => {
  1142. this.picihaolist = res.data.data;
  1143. });
  1144. },
  1145. // 批次号
  1146. picihaolistChangefun(value, row) {
  1147. for (let item of this.picihaolist) {
  1148. if (item.dot == value) {
  1149. this.$set(row, "inventory", item.balanceQuantity);
  1150. }
  1151. }
  1152. },
  1153. // 确认调拨
  1154. complete() {
  1155. if (!this.form.id) {
  1156. this.$message.warning("请先保存数据");
  1157. return;
  1158. }
  1159. this.$refs["form"].validate((valid, done) => {
  1160. done();
  1161. if (valid) {
  1162. if (this.whetherFinancing == 1) {
  1163. for (let item of this.form.shipItemsList) {
  1164. if (item.historyList.length == 0) {
  1165. return this.$message.error("请维护出库明细的库区");
  1166. }
  1167. }
  1168. }
  1169. for (let item of this.form.shipItemsList) {
  1170. if (!item.dot && item.whether == 1) {
  1171. return this.$message.error("请维护明细信息的批次号");
  1172. }
  1173. }
  1174. const loading = this.$loading({
  1175. lock: true,
  1176. text: "加载中",
  1177. spinner: "el-icon-loading",
  1178. background: "rgba(255,255,255,0.7)"
  1179. });
  1180. this.form.shipItemsList.forEach(item => {
  1181. item.goodsName = item.$goodsId;
  1182. });
  1183. transferAllocateSubmit({
  1184. ...this.form,
  1185. bizTypeName: "DBGD"
  1186. })
  1187. .then(res => {
  1188. confirmTransferAllocate({
  1189. ...this.form,
  1190. bizTypeName: "DBGD"
  1191. })
  1192. .then(res => {
  1193. this.$message.success("调拨完成");
  1194. this.refresh(this.form.id);
  1195. })
  1196. .finally(() => {
  1197. loading.close();
  1198. });
  1199. })
  1200. .catch(() => {
  1201. loading.close();
  1202. });
  1203. } else {
  1204. this.$message.error("请选择库管");
  1205. }
  1206. });
  1207. },
  1208. //修改提交触发
  1209. editCustomer() {
  1210. this.$refs["form"].validate((valid, done) => {
  1211. done();
  1212. if (valid) {
  1213. const loading = this.$loading({
  1214. lock: true,
  1215. text: "加载中",
  1216. spinner: "el-icon-loading",
  1217. background: "rgba(255,255,255,0.7)"
  1218. });
  1219. // this.goodsName;
  1220. transferAllocateSubmit({
  1221. ...this.form,
  1222. bizTypeName: "DBGD",
  1223. filesList: this.filesList
  1224. })
  1225. .then(res => {
  1226. this.$message.success("保存成功");
  1227. this.refresh(res.data.data.id);
  1228. })
  1229. .finally(() => {
  1230. loading.close();
  1231. });
  1232. } else {
  1233. return false;
  1234. }
  1235. });
  1236. },
  1237. refresh(id, type) {
  1238. const loading = this.$loading({
  1239. lock: true,
  1240. text: "加载中",
  1241. spinner: "el-icon-loading",
  1242. background: "rgba(255,255,255,0.7)"
  1243. });
  1244. getDetails({ id: id })
  1245. .then(res => {
  1246. if (res.data.data.statusName == "确认调拨") {
  1247. this.editDisabled = true;
  1248. this.optionForm.disabled = true;
  1249. }
  1250. if (type && !this.editButton) {
  1251. this.editDisabled = false;
  1252. this.optionForm.disabled = false;
  1253. }
  1254. this.form = res.data.data;
  1255. this.filesList = res.data.data.filesList;
  1256. this.$nextTick(() => {
  1257. this.$refs.formContacts.refreshTable();
  1258. });
  1259. })
  1260. .finally(() => {
  1261. loading.close();
  1262. });
  1263. },
  1264. rowDelBox(row, index) {
  1265. this.$confirm("确定将选择数据删除?", {
  1266. confirmButtonText: "确定",
  1267. cancelButtonText: "取消",
  1268. type: "warning"
  1269. }).then(() => {
  1270. if (row.id) {
  1271. tradingBox(row.id).then(res => {
  1272. this.form.shipItemsList.splice(index, 1);
  1273. this.$message.success("操作成功!");
  1274. });
  1275. } else {
  1276. this.form.shipItemsList.splice(index, 1);
  1277. this.$message.success("操作成功!");
  1278. }
  1279. });
  1280. },
  1281. rowSave(form, done, loading) {
  1282. done(form);
  1283. },
  1284. rowUpdate(form, index, done, loading) {
  1285. done(form);
  1286. },
  1287. //打印
  1288. handlePrint() {
  1289. this.switchDialog = !this.switchDialog;
  1290. },
  1291. onClose(val) {
  1292. this.switchDialog = val;
  1293. },
  1294. // 新增出库明细
  1295. adddiailsfun() {
  1296. if (!this.form.storageId) {
  1297. this.$message.warning("请选择调出仓库!");
  1298. return;
  1299. }
  1300. if(!this.form.callInStorageId) {
  1301. this.$message.warning("请选择调入仓库!");
  1302. return;
  1303. }
  1304. this.$refs.dialogAssemblyRef.dialogVisible = true;
  1305. this.$refs.dialogAssemblyRef.getAllWorkDicts();
  1306. // this.dialogVisible = true
  1307. },
  1308. //编辑
  1309. confirmEditing() {
  1310. this.editButton = false;
  1311. if (this.form.statusName == "录入") {
  1312. this.editDisabled = false;
  1313. this.optionForm.disabled = false;
  1314. }
  1315. if (this.form.statusName == "确认调拨") {
  1316. this.editDisabled = true;
  1317. this.optionForm.disabled = true;
  1318. }
  1319. },
  1320. calculator(row) {
  1321. if (row.sendNumFinancing > row.inventoryFinancing) {
  1322. this.$set(row, "sendNumFinancing", null);
  1323. this.$message.error("融资数量不能大于参考库存融资");
  1324. }
  1325. if (row.sendNumHave > row.inventoryHave) {
  1326. this.$set(row, "sendNumHave", null);
  1327. this.$message.error("自由数量不能大于参考库存自有");
  1328. }
  1329. row.goodsNum = Number(Number(row.sendNumFinancing) + Number(row.sendNumHave));
  1330. row.subTotalMoney = row.goodsNum * row.price;
  1331. },
  1332. calculator2(row) {
  1333. if (row.goodsNum > row.inventory) {
  1334. this.$set(row, "goodsNum", null);
  1335. this.$message.error("调拨数量不能大于库存");
  1336. }
  1337. row.subTotalMoney = row.goodsNum * row.price;
  1338. },
  1339. // 导入按钮事件
  1340. tableDataHandle(arr) {
  1341. this.tableData = arr;
  1342. // 循环获取库存数量
  1343. for (let item of this.tableData) {
  1344. let obj = {
  1345. goodsId: item.id,
  1346. price: item.price, // 单价
  1347. goodsName: item.cname,
  1348. goodsNum: item.goodsNum,
  1349. sendNumFinancing: this.whetherFinancing == 1 ? item.sendNumFinancing : 0,
  1350. sendNumHave: this.whetherFinancing == 1 ? item.sendNumHave : 0,
  1351. brandName: item.brandName,
  1352. brandId: item.brandId,
  1353. goodsNo: item.code,
  1354. propertyName: item.specificationAndModel,
  1355. inventory: item.inventory,
  1356. inventoryHave: this.whetherFinancing == 1 ? item.inventoryHave : 0,
  1357. inventoryFinancing: this.whetherFinancing == 1 ? item.inventoryFinancing : 0,
  1358. pattern: item.brandItem,
  1359. goodsDescription: item.goodsDescription,
  1360. dot: item.dot,
  1361. whether: item.whether,
  1362. units: item.unit,
  1363. // 小计
  1364. subTotalMoney: item.goodsNum * item.price,
  1365. // 备注
  1366. remarks: item.remarks,
  1367. // 批次号的状态
  1368. dotedittype: false,
  1369. // 价格数量
  1370. goodsNumtype: false,
  1371. // 价格
  1372. pricetype: false,
  1373. historyList: [],
  1374. $cellEdit: this.reservoirArea == 1 ? false : true
  1375. };
  1376. this.form.shipItemsList.push(obj);
  1377. }
  1378. this.$refs.dialogAssemblyRef.dialogVisible = false;
  1379. this.$nextTick(() => {
  1380. this.$refs.formContacts.doLayout();
  1381. this.$refs.formContacts.refreshTable();
  1382. });
  1383. },
  1384. //自定义列保存
  1385. async saveColumnTwo(ref, option, optionBack, code) {
  1386. /**
  1387. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1388. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1389. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1390. */
  1391. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1392. isProcurement({ param: "whether.model" }).then(res => {
  1393. if (res.data.data == 1) {
  1394. this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
  1395. }
  1396. });
  1397. if (inSave) {
  1398. this.$message.success("保存成功");
  1399. //关闭窗口
  1400. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1401. }
  1402. },
  1403. //自定义列重置
  1404. async resetColumnTwo(ref, option, optionBack, code) {
  1405. this[option] = this[optionBack];
  1406. isProcurement({ param: "whether.model" }).then(res => {
  1407. if (res.data.data == 1) {
  1408. this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
  1409. }
  1410. });
  1411. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1412. if (inSave) {
  1413. this.$message.success("重置成功");
  1414. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1415. }
  1416. },
  1417. backToList(type) {
  1418. this.$emit("backToList", type);
  1419. // this.$store.commit("DOMIO_OUT_DETAIL");
  1420. }
  1421. }
  1422. };
  1423. </script>
  1424. <style lang="scss" scoped>
  1425. ::v-deep .el-form-item {
  1426. margin-bottom: 8px !important;
  1427. }
  1428. </style>