index.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669
  1. <template>
  2. <el-dialog
  3. v-dialog-drag
  4. title="快速出库"
  5. :visible.sync="visible"
  6. width="85%"
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. :before-close="closeDialog"
  10. >
  11. <el-form :model="form" :rules="rules" label-width="80px" ref="form">
  12. <el-row>
  13. <el-col :xs="12" :sm="6">
  14. <el-form-item label="提单号" prop="fMblno">
  15. <el-input
  16. v-model="form.fMblno"
  17. placeholder="请输入提单号"
  18. clearable
  19. @change="changeMblno"
  20. style="width: 100%"
  21. />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :xs="12" :sm="6">
  25. <el-form-item label="客户名称" prop="fCorpid">
  26. <el-select
  27. v-model="form.fCorpid"
  28. clearable
  29. filterable
  30. placeholder="请输入关键词"
  31. @change="changeCorp"
  32. style="width: 100%"
  33. :disabled="detailList.length > 0"
  34. >
  35. <el-option
  36. v-for="(item, index) in fMblnoOptions"
  37. :key="index.fId"
  38. :label="item.fName"
  39. :value="item.fId"
  40. ></el-option>
  41. </el-select>
  42. </el-form-item>
  43. </el-col>
  44. <el-col :xs="12" :sm="6">
  45. <el-form-item label="出库日期" prop="fBsdate">
  46. <el-date-picker
  47. type="date"
  48. v-model="form.fBsdate"
  49. value-format="timestamp"
  50. format="yyyy-MM-dd"
  51. placeholder="请选择计划日期"
  52. style="width: 100%"
  53. ></el-date-picker>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :xs="12" :sm="6">
  57. <el-form-item label="出库时间" prop="fBstime">
  58. <el-time-picker
  59. v-model="form.fBstime"
  60. :picker-options="{
  61. selectableRange: '00:00:00 - 23:59:59',
  62. }"
  63. :clearable="true"
  64. value-format="timestamp"
  65. placeholder="任意时间点"
  66. style="width: 100%"
  67. ></el-time-picker>
  68. </el-form-item>
  69. </el-col>
  70. <el-col :xs="12" :sm="6">
  71. <el-form-item label="仓库" prop="fWarehouseid">
  72. <el-select
  73. v-model="form.fWarehouseid"
  74. filterable
  75. placeholder="请选择"
  76. @change="changefWarehouseid"
  77. style="width: 100%"
  78. :disabled="detailList.length > 0"
  79. >
  80. <el-option
  81. v-for="(item, index) in warehouseOptions"
  82. :key="index.fId"
  83. :label="item.fName"
  84. :value="item.fId"
  85. ></el-option>
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :xs="12" :sm="6">
  90. <el-form-item label="品名" prop="fGoodsid">
  91. <el-select
  92. filterable
  93. v-model="form.fGoodsid"
  94. placeholder="请选择品名"
  95. @change="goodsChange"
  96. style="width: 100%"
  97. clearable
  98. >
  99. <el-option
  100. v-for="(item, index) in goodsOptions"
  101. :key="index.fId"
  102. :label="item.fName"
  103. :value="item.fId"
  104. ></el-option>
  105. </el-select>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :xs="12" :sm="6">
  109. <el-form-item label="品名属性" prop="fGoodsType">
  110. <el-select
  111. filterable
  112. v-model="form.fGoodsType"
  113. placeholder="请选择商品属性"
  114. style="width: 100%"
  115. >
  116. <el-option
  117. v-for="(item, index) in fStorageTypeOptions"
  118. :key="index.dictValue"
  119. :label="item.dictLabel"
  120. :value="item.dictValue"
  121. />
  122. </el-select>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :xs="12" :sm="6">
  126. <el-form-item label="属性内容">
  127. <el-input
  128. v-model="form.fMarks"
  129. placeholder="请填写属性描述"
  130. clearable
  131. style="width: 100%"
  132. />
  133. </el-form-item>
  134. </el-col>
  135. <el-col :xs="12" :sm="6">
  136. <el-form-item label="车号">
  137. <el-input
  138. placeholder="请输入车号"
  139. v-model="form.fTruckno"
  140. style="width: 100%"
  141. ></el-input>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :xs="12" :sm="6">
  145. <el-form-item label="司机">
  146. <el-input
  147. placeholder="请输入司机姓名"
  148. v-model="form.fDriverName"
  149. style="width: 100%"
  150. ></el-input>
  151. </el-form-item>
  152. </el-col>
  153. <el-col :xs="12" :sm="6">
  154. <el-form-item label="电话">
  155. <el-input
  156. placeholder="请输入司机电话"
  157. v-model="form.fDriverTel"
  158. style="width: 100%"
  159. ></el-input>
  160. </el-form-item>
  161. </el-col>
  162. <el-col :xs="12" :sm="6">
  163. <el-form-item label="证件号">
  164. <el-input
  165. placeholder="请输入证件号"
  166. v-model="form.fDriverIdCar"
  167. style="width: 100%"
  168. ></el-input>
  169. </el-form-item>
  170. </el-col>
  171. </el-row>
  172. <el-row>
  173. <el-col :span="24">
  174. <el-form-item label="备注">
  175. <el-input
  176. type="textarea"
  177. :autosize="{ minRows: 2, maxRows: 4}"
  178. placeholder="请输入备注"
  179. v-model="form.remark"
  180. style="width: 100%"
  181. >
  182. </el-input>
  183. </el-form-item>
  184. </el-col>
  185. </el-row>
  186. <div style="margin: 10px 0">
  187. <!-- 列设置-->
  188. <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag append-to-body>
  189. <template slot="title">
  190. <div class="avue-crud__dialog__header">
  191. <span class="el-dialog__title">
  192. <span
  193. style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  194. </span>
  195. </div>
  196. </template>
  197. <div>配置排序列数据(拖动调整顺序)</div>
  198. <div style="margin-left: 17px">
  199. <el-checkbox
  200. v-model="allCheck"
  201. label="全选"
  202. @change="allChecked"
  203. ></el-checkbox>
  204. </div>
  205. <div style="padding: 4px; display: flex; justify-content: center">
  206. <draggable
  207. v-model="setRowList"
  208. group="site"
  209. animation="300"
  210. @start="onStart"
  211. @end="onEnd"
  212. handle=".indraggable"
  213. >
  214. <transition-group>
  215. <div
  216. v-for="item in setRowList"
  217. :key="item.surface"
  218. class="listStyle"
  219. >
  220. <div style="width: 500px" class="indraggable">
  221. <div class="progress" :style="{ width: item.width + 'px' }">
  222. <el-checkbox
  223. :label="item.name"
  224. v-model="item.checked"
  225. :true-label="0"
  226. :false-label="1"
  227. >{{ item.name }}
  228. </el-checkbox>
  229. </div>
  230. </div>
  231. <el-input-number
  232. v-model.number="item.width"
  233. controls-position="right"
  234. :min="1"
  235. :max="500"
  236. size="mini"
  237. ></el-input-number>
  238. </div>
  239. </transition-group>
  240. </draggable>
  241. </div>
  242. <span slot="footer" class="dialog-footer">
  243. <el-button @click="showSetting = false">取 消</el-button>
  244. <el-button @click="delRow" type="danger">重 置</el-button>
  245. <el-button type="primary" @click="save()">确 定</el-button>
  246. </span>
  247. </el-dialog>
  248. <el-tabs v-model="activeName">
  249. <el-tab-pane label="出库明细" name="outStockList">
  250. <div style="margin: 10px 10px">
  251. <el-button
  252. size="small"
  253. style="float:left;"
  254. type="primary"
  255. @click="addList"
  256. :disabled="disabled"
  257. >
  258. 检索
  259. </el-button>
  260. <el-button
  261. size="small"
  262. style="float:left;"
  263. type="danger"
  264. :disabled="selection.length == 0"
  265. @click="batchDelete"
  266. >
  267. 批量删除
  268. </el-button>
  269. <el-button
  270. icon="el-icon-setting"
  271. size="mini"
  272. circle
  273. @click="showSetting = !showSetting"
  274. style="float: right"
  275. ></el-button>
  276. </div>
  277. <el-table
  278. :data="detailList"
  279. tooltip-effect="dark"
  280. stripe
  281. ref="detailTable"
  282. @selection-change="handleSelection"
  283. show-summary
  284. :summary-method="getSummaries"
  285. >
  286. <el-table-column type="selection" width="50" align="center" fixed/>
  287. <el-table-column
  288. label="序号"
  289. type="index"
  290. width="50"
  291. fixed
  292. align="center"
  293. />
  294. <el-table-column
  295. v-for="(item, index) in getRowList"
  296. :key="index"
  297. :label="item.name"
  298. :width="item.width"
  299. :prop="item.label"
  300. align="center"
  301. :fixed="item.fixed"
  302. :show-overflow-tooltip="true"
  303. sortable
  304. >
  305. <template slot-scope="scope">
  306. <span v-if="item.label == 'fGoodsid'">
  307. {{ scope.row.fGoodsids }}
  308. </span>
  309. <!-- <span v-else-if="item.label == 'fCntrno'">-->
  310. <!-- <el-input-->
  311. <!-- v-model="scope.row.fCntrno"-->
  312. <!-- placeholder="请输入箱号"-->
  313. <!-- clearable-->
  314. <!-- ></el-input>-->
  315. <!-- </span>-->
  316. <span v-else-if="item.label == 'fSealno'">
  317. <el-input
  318. v-model="scope.row.fSealno"
  319. placeholder="请输入封号"
  320. clearable
  321. ></el-input>
  322. </span>
  323. <span v-else-if="item.label == 'fNowCarton'">
  324. <el-input
  325. v-model="scope.row.fNowCarton"
  326. placeholder="请输入现箱号"
  327. clearable
  328. ></el-input>
  329. </span>
  330. <span v-else-if="item.label == 'fBusinessType'">
  331. <el-select
  332. v-model="scope.row.fBusinessType"
  333. filterable
  334. disabled
  335. placeholder="请选择商品属性"
  336. >
  337. <el-option
  338. v-for="(item, index) in fStorageTypeOptions"
  339. :key="index.dictValue"
  340. :label="item.dictLabel"
  341. :value="item.dictValue"
  342. />
  343. </el-select>
  344. </span>
  345. <span v-else-if="item.label == 'fQty'">
  346. <el-input
  347. v-input-limit="0"
  348. @change="qtyChange(scope.row)"
  349. v-model="scope.row.fQty"
  350. placeholder="出库件数"
  351. />
  352. </span>
  353. <span v-else-if="item.label == 'fGrossweight'">
  354. <el-input
  355. v-input-limit="2"
  356. v-model="scope.row.fGrossweight"
  357. @change="changeOutStock(scope.row)"
  358. placeholder="出库毛重"
  359. />
  360. </span>
  361. <span v-else-if="item.label == 'fNetweight'">
  362. <el-input
  363. v-input-limit="2"
  364. v-model="scope.row.fNetweight"
  365. @change="changeOutStock(scope.row)"
  366. placeholder="出库净重"
  367. />
  368. </span>
  369. <span v-else-if="item.label == 'remark'">
  370. <el-input
  371. v-model="scope.row.remark"
  372. placeholder="备注"
  373. />
  374. </span>
  375. <span v-else>{{ scope.row[item.label] }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. header-align="center"
  380. align="center"
  381. label="操作"
  382. width="160px"
  383. fixed="right"
  384. >
  385. <template slot-scope="scope">
  386. <el-button
  387. type="text"
  388. @click.native.prevent="wDeleteRow(scope.$index, detailList)"
  389. size="small"
  390. >移除
  391. </el-button
  392. >
  393. </template>
  394. </el-table-column>
  395. </el-table>
  396. </el-tab-pane>
  397. <el-tab-pane label="收款信息" name="DrList">
  398. <div style="margin: 10px 10px">
  399. <el-button
  400. size="small"
  401. style="float:left;"
  402. type="primary"
  403. @click="addDrList"
  404. >
  405. 新行
  406. </el-button>
  407. </div>
  408. <el-table
  409. ref="DrTable"
  410. :data="DrList"
  411. tooltip-effect="dark"
  412. stripe
  413. >
  414. <el-table-column label="序号" type="index" width="50" fixed></el-table-column>
  415. <el-table-column
  416. prop="fCorpid"
  417. header-align="center"
  418. align="center"
  419. width="300px"
  420. label="客户名称"
  421. >
  422. <template slot-scope="scope">
  423. <el-select
  424. v-model="scope.row.fCorpid"
  425. filterable
  426. clearable
  427. placeholder="客户名称"
  428. >
  429. <el-option
  430. v-for="(item, index) in fMblnoOptions"
  431. :key="index.fId"
  432. :label="item.fName"
  433. :value="item.fId"
  434. ></el-option>
  435. </el-select>
  436. </template>
  437. </el-table-column>
  438. <el-table-column
  439. prop="fFeeid"
  440. header-align="center"
  441. align="center"
  442. width="240px"
  443. label="费用名称"
  444. >
  445. <template slot-scope="scope">
  446. <el-select
  447. v-model="scope.row.fFeeid"
  448. clearable
  449. filterable
  450. placeholder="费用名称"
  451. >
  452. <el-option
  453. v-for="(item, index) in fDNameOptions"
  454. :key="index.fId"
  455. :label="item.fName"
  456. :value="item.fId"
  457. ></el-option>
  458. </el-select>
  459. </template>
  460. </el-table-column>
  461. <el-table-column
  462. prop="fFeeUnitid"
  463. header-align="center"
  464. align="center"
  465. width="180px"
  466. label="计价单位"
  467. >
  468. <template slot-scope="scope">
  469. <el-select
  470. v-model="scope.row.fFeeUnitid"
  471. placeholder="请选择计价单位"
  472. clearable
  473. @change="changeFeeUnit(scope.row)"
  474. >
  475. <el-option
  476. v-for="(item, index) in fFeetUnitOptions"
  477. :key="index.dictValue"
  478. :label="item.dictLabel"
  479. :value="item.dictValue"
  480. />
  481. </el-select>
  482. </template>
  483. </el-table-column>
  484. <el-table-column
  485. prop="fQty"
  486. header-align="center"
  487. align="center"
  488. width="130px"
  489. label="数量"
  490. >
  491. <template slot-scope="scope">
  492. <el-input
  493. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  494. v-model="scope.row.fQty"
  495. placeholder="数量"
  496. @change="changeContractAmt(scope.row)"
  497. show-word-limit
  498. />
  499. </template>
  500. </el-table-column>
  501. <el-table-column
  502. prop="fUnitprice"
  503. header-align="center"
  504. align="center"
  505. width="130px"
  506. label="单价"
  507. >
  508. <template slot-scope="scope">
  509. <el-input
  510. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  511. v-model="scope.row.fUnitprice"
  512. placeholder="单价"
  513. @change="changeContractAmt(scope.row)"
  514. show-word-limit
  515. />
  516. </template>
  517. </el-table-column>
  518. <el-table-column
  519. prop="fAmount"
  520. header-align="center"
  521. align="center"
  522. width="130px"
  523. label="金额"
  524. >
  525. <template slot-scope="scope">
  526. <el-input
  527. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  528. v-model="scope.row.fAmount"
  529. placeholder="金额"
  530. show-word-limit
  531. />
  532. </template>
  533. </el-table-column>
  534. <el-table-column
  535. prop="fMblno"
  536. header-align="center"
  537. align="center"
  538. width="130px"
  539. label="提单号"
  540. >
  541. <template slot-scope="scope">
  542. <el-input
  543. v-model="scope.row.fMblno"
  544. placeholder="提单号"
  545. show-word-limit
  546. />
  547. </template>
  548. </el-table-column>
  549. <el-table-column
  550. prop="fProductName"
  551. header-align="center"
  552. align="center"
  553. width="140px"
  554. label="品名"
  555. >
  556. <template slot-scope="scope">
  557. <el-input
  558. v-model="scope.row.fProductName"
  559. placeholder="品名"
  560. show-word-limit
  561. />
  562. </template>
  563. </el-table-column>
  564. <el-table-column
  565. prop="fMarks"
  566. header-align="center"
  567. align="center"
  568. width="130px"
  569. label="品牌"
  570. >
  571. <template slot-scope="scope">
  572. <el-input
  573. v-model="scope.row.fMarks"
  574. placeholder="品牌"
  575. show-word-limit
  576. />
  577. </template>
  578. </el-table-column>
  579. <el-table-column
  580. prop="fSrcTypeId"
  581. header-align="center"
  582. align="center"
  583. width="130px"
  584. label="来源"
  585. >
  586. <template slot-scope="scope">
  587. <span v-if="scope.row.fSrcTypeId === 0">录入</span>
  588. <span v-if="scope.row.fSrcTypeId == 1">协议</span>
  589. <span v-if="scope.row.fSrcTypeId == 10">变更</span>
  590. </template>
  591. </el-table-column>
  592. <el-table-column
  593. prop="remark"
  594. header-align="center"
  595. align="center"
  596. width="150px"
  597. label="备注"
  598. >
  599. <template slot-scope="scope">
  600. <el-input
  601. v-model="scope.row.remark"
  602. placeholder="备注"
  603. show-word-limit
  604. />
  605. </template>
  606. </el-table-column>
  607. <el-table-column
  608. header-align="center"
  609. align="center"
  610. label="操作"
  611. width="200px"
  612. fixed="right"
  613. >
  614. <template slot-scope="scope">
  615. <el-button
  616. @click.native.prevent="deleteDrRow(scope.$index, DrList)"
  617. size="small"
  618. >移除
  619. </el-button>
  620. <el-button
  621. size="small"
  622. @click="listCheck(scope.row)"
  623. v-if="scope.row.fBillstatus < 6"
  624. >请核</el-button>
  625. <el-button
  626. size="small"
  627. @click="revokeListCheck(scope.row)"
  628. v-if="scope.row.fBillstatus == 6"
  629. >撤销请核</el-button>
  630. </template>
  631. </el-table-column>
  632. </el-table>
  633. </el-tab-pane>
  634. </el-tabs>
  635. </div>
  636. </el-form>
  637. <!-- 打印-->
  638. <el-dialog
  639. append-to-body
  640. :close-on-click-modal="false"
  641. :modal="false"
  642. :visible.sync="printVisible"
  643. >
  644. <div id="print_ckd">
  645. <div style="text-align: center;font-size: 24px;margin-bottom: 5px;">出库单</div>
  646. <div style="text-align: center;font-size: 24px;margin-bottom: 5px;">{{ company }}</div>
  647. <div class="print_table" style="display: flex">
  648. <table border="0" cellspacing="0" cellpadding="0" style="width: 100%; line-height: 30px">
  649. <tr>
  650. <td>客户名</td>
  651. <td v-for="item in fMblnoOptions" v-if="item.fId == form.fCorpid">{{ item.fName }}</td>
  652. <td>日期</td>
  653. <td>{{ form.fBsdate | fBsdateFormat }}</td>
  654. <td>流水号</td>
  655. <td colspan="2">{{ detailList.length > 0 ? detailList[0].fSerialNumber : '' }}</td>
  656. </tr>
  657. <tr>
  658. <td>车号</td>
  659. <td colspan="1">{{ form.fTruckno }}</td>
  660. <td colspan="1">提单号</td>
  661. <td colspan="4">{{ form.fMblno }}</td>
  662. </tr>
  663. <tr>
  664. <td>货名</td>
  665. <td>箱号</td>
  666. <td>铅封号</td>
  667. <td>件数</td>
  668. <td>规格</td>
  669. <td>区位</td>
  670. <td>备注</td>
  671. </tr>
  672. <tr v-for="(item, index) in detailList" :key="index">
  673. <td v-for="row in goodsOptions" v-if="row.fId == item.fGoodsid">{{ row.fName }}</td>
  674. <td>{{ item.fCntrno }}</td>
  675. <td>{{ item.fSealno }}</td>
  676. <td>{{ item.fQty }}</td>
  677. <td>{{ item.fMarks }}</td>
  678. <td>{{ item.fWarehouseInformation }}</td>
  679. <td>{{ item.remark }}</td>
  680. </tr>
  681. <tr>
  682. <td>备注</td>
  683. <td colspan="4">{{ form.remark }}</td>
  684. <td>总件数</td>
  685. <td>{{ allfQty }}</td>
  686. </tr>
  687. </table>
  688. </div>
  689. <div style="display: flex; justify-content: space-between; font-size: 12px;margin-top: 8px">
  690. <div>操作:</div>
  691. <div>理货:</div>
  692. <div>叉车:</div>
  693. <div>司机:</div>
  694. <div style="width: 150px">电话:</div>
  695. </div>
  696. </div>
  697. <span slot="footer" class="dialog-footer">
  698. <el-button
  699. type="primary"
  700. @click="
  701. addprint('ckd');
  702. printVisible = false;
  703. "
  704. >打印
  705. </el-button>
  706. <el-button @click="printVisible = false">取消</el-button>
  707. </span>
  708. </el-dialog>
  709. <span slot="footer" class="dialog-footer">
  710. <el-button type="success" @click="handleSave">暂存</el-button>
  711. <el-button type="warning" @click="openPrint" :disabled="detailList.length == 0">打印</el-button>
  712. <el-button type="primary" @click="handleConfirm" :disabled="detailList.length == 0">确认出库</el-button>
  713. <el-button @click="closeDialog">取消</el-button>
  714. </span>
  715. </el-dialog>
  716. </template>
  717. <script>
  718. import Cookies from "js-cookie";
  719. import draggable from "vuedraggable";
  720. import {listCorps} from "@/api/basicdata/corps";
  721. import {
  722. treeselect,
  723. listWarehousesss,
  724. } from "@/api/basicdata/warehouse";
  725. import {listGoods} from "@/api/basicdata/goods";
  726. import {queryUserVal} from "@/api/system/user";
  727. import {listWhgenleg} from "@/api/reportManagement/whgenleg";
  728. import {addSet, resetModule, select} from '@/api/system/set';
  729. import {changeSelect, fastOutStock, saveOutstock} from "@/api/warehouseBusiness/fastOutStock";
  730. import print from "print-js";
  731. import {listFees, getFees} from "@/api/basicdata/fees";
  732. import {feesCheck,revokefeeCheck} from "@/api/warehouseBusiness/warehouseOutStock";
  733. export default {
  734. name: "fastOutStock",
  735. props: {},
  736. components: {
  737. draggable,
  738. },
  739. data() {
  740. return {
  741. loading: false,
  742. activeName: 'outStockList',
  743. disabled: false,
  744. visible: false,
  745. printVisible: false,
  746. company: '',
  747. form: {},
  748. detailList: [],
  749. fMblnoOptions: [],
  750. // 仓库
  751. warehouseOptions: [],
  752. // 品名
  753. goodsOptions: [],
  754. // 品名属性
  755. fStorageTypeOptions: [],
  756. fWarehouseidOptions: [],
  757. rules: {
  758. fCorpid: [{required: true, message: " ", trigger: "blur"}],
  759. fBsdate: [{required: true, message: " ", trigger: "blur"}],
  760. fWarehouseid: [{required: true, message: " ", trigger: "blur"}],
  761. fTruckno: [{required: true, message: " ", trigger: "blur"}],
  762. },
  763. selection: [],
  764. allfQty: 0,
  765. DrList: [],
  766. fFeetUnitOptions: [],
  767. fDNameOptions: [],
  768. // 设置列开关
  769. showSetting: false,
  770. setRowList: [],
  771. getRowList: [],
  772. tableDate: [
  773. {
  774. surface: "1",
  775. label: "fMblno",
  776. name: "提单号",
  777. checked: 0,
  778. width: 100,
  779. },
  780. {
  781. surface: "2",
  782. label: "fCntrno",
  783. name: "箱号",
  784. checked: 0,
  785. width: 100,
  786. },
  787. {
  788. surface: "3",
  789. label: "fSealno",
  790. name: "封号",
  791. checked: 0,
  792. width: 100,
  793. },
  794. {
  795. surface: "4",
  796. label: "fGoodsid",
  797. name: "品名",
  798. checked: 0,
  799. width: 150,
  800. },
  801. {
  802. surface: "5",
  803. label: "fBusinessType",
  804. name: "货物属性",
  805. checked: 0,
  806. width: 100,
  807. },
  808. {
  809. surface: "6",
  810. label: "fMarks",
  811. name: "属性详情",
  812. checked: 0,
  813. width: 100,
  814. },
  815. {
  816. surface: "7",
  817. label: "fWarehouseInformation",
  818. name: "库区",
  819. checked: 0,
  820. width: 150,
  821. },
  822. {
  823. surface: "8",
  824. label: "fPlanqty",
  825. name: "结余库存",
  826. checked: 0,
  827. width: 100,
  828. },
  829. {
  830. surface: "9",
  831. label: "fPlangrossweight",
  832. name: "结余毛重(kg)",
  833. checked: 0,
  834. width: 120,
  835. },
  836. {
  837. surface: "10",
  838. label: "fPlannetweight",
  839. name: "结余净重(kg)",
  840. checked: 0,
  841. width: 120,
  842. },
  843. {
  844. surface: "11",
  845. label: "fQty",
  846. name: "件数",
  847. checked: 0,
  848. width: 100,
  849. },
  850. {
  851. surface: "12",
  852. label: "fGrossweight",
  853. name: "毛重(kg)",
  854. checked: 0,
  855. width: 120,
  856. },
  857. {
  858. surface: "13",
  859. label: "fNetweight",
  860. name: "净重(kg)",
  861. checked: 0,
  862. width: 120,
  863. },
  864. {
  865. surface: "14",
  866. label: "fNowCarton",
  867. name: "现箱号",
  868. checked: 0,
  869. width: 120,
  870. },
  871. {
  872. surface: "14",
  873. label: "remark",
  874. name: "备注",
  875. checked: 0,
  876. width: 100,
  877. },
  878. ],
  879. // 库位的地址
  880. stockaddr: '',
  881. balance: 0,
  882. //自定义列宽
  883. allCheck: false,
  884. drag: false,
  885. }
  886. },
  887. created() {
  888. this.setRowList = this.tableDate;
  889. this.getRowList = this.tableDate;
  890. listCorps({type: 1}).then((response) => {
  891. this.fMblnoOptions = response.rows;
  892. });
  893. listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
  894. this.warehouseOptions = response.rows;
  895. });
  896. listGoods({fStatus: 0, delFlag: 0}).then((response) => {
  897. this.goodsOptions = response.rows;
  898. });
  899. listFees({fDc: "D"}).then((response) => {
  900. this.fDNameOptions = response.rows;
  901. });
  902. this.getDicts("storage_type").then((response) => {
  903. this.fStorageTypeOptions = response.data;
  904. localStorage.setItem("fStorageTypeList", JSON.stringify(response.data));
  905. });
  906. this.getDicts("data_unitfees").then((response) => {
  907. this.fFeetUnitOptions = response.data;
  908. });
  909. this.getRow()
  910. },
  911. filters: {
  912. fBsdateFormat(row) {
  913. if (row) {
  914. const dateMat = new Date(row);
  915. const year = dateMat.getFullYear();
  916. const month = dateMat.getMonth() + 1;
  917. const day = dateMat.getDate();
  918. const timeFormat = year + "-" + month + "-" + day;
  919. return timeFormat;
  920. }
  921. },
  922. },
  923. methods: {
  924. // 打开
  925. init() {
  926. this.queryUser();
  927. this.company = Cookies.get("companyName")
  928. this.visible = true;
  929. },
  930. // 关闭弹窗
  931. closeDialog() {
  932. this.visible = false;
  933. this.form = {}
  934. this.detailList = []
  935. this.$refs.form.clearValidate();
  936. this.$emit("closeDialog")
  937. },
  938. //获取登陆人
  939. queryUser() {
  940. queryUserVal().then((response) => {
  941. if (response.user !== null) {
  942. this.userVal = response.user;
  943. this.$set(this.form, "fDeptid", this.userVal.deptId);
  944. this.$set(this.form, "createBy", this.userVal.userName);
  945. this.$set(this.form, "fStorekeeper", this.userVal.nickName);
  946. this.$set(this.form, "fIfdamage", "1");
  947. this.$set(this.form, "fIfweigh", "1");
  948. this.$set(this.form, "fTrademodeid", "1");
  949. this.$set(this.form, "createTime", Date.parse(new Date()));
  950. this.$set(this.form, "fBstime", Date.parse(new Date()));
  951. this.$set(this.form, "fFeetUnit", "2");
  952. this.$set(this.form, "fFeetunit", 2);
  953. this.$set(this.form, "fBusinessType", "5");
  954. }
  955. if (response.dept !== null) {
  956. this.deptOptions = [];
  957. this.deptOptions.push(response.dept);
  958. }
  959. });
  960. },
  961. handleSelection(list) {
  962. this.selection = list
  963. },
  964. // 打开打印窗口
  965. openPrint() {
  966. this.balance = 0;
  967. for (let item in this.detailList) {
  968. for (let item in this.detailList) {
  969. if (!this.detailList[item].fId) {
  970. return this.$message.error('数据未保存,请先暂存')
  971. }
  972. }
  973. // if (!this.detailList[item].fCntrno) {
  974. // return this.$message.error('第' + (Number(item) + 1) + '行箱号不能为空')
  975. // }
  976. if (this.detailList[item].fPlanqty < this.detailList[item].fQty) {
  977. return this.$message.error("第" + (Number(item) + 1) + "行出库件数超出结余件数!");
  978. }
  979. this.balance = this.detailList[item].fPlanqty
  980. console.log(this.detailList[item])
  981. for (let item1 in this.detailList) {
  982. if (this.detailList[item].fSrcid == this.detailList[item1].fSrcid) {
  983. this.balance = Number(this.balance) - Number(this.detailList[item].fQty)
  984. if (this.balance < 0) {
  985. return this.$message.error("第" + (Number(item1) + 1) + "行出库件数超出结余件数!");
  986. }
  987. }
  988. }
  989. }
  990. this.warehouseOptions.map((e) => {
  991. if (e.fId == this.form.fWarehouseid) {
  992. this.stockaddr = e.fAddr;
  993. }
  994. });
  995. this.allfQty = 0;
  996. this.detailList.forEach(item => {
  997. this.allfQty += Number(item.fQty)
  998. })
  999. this.printVisible = true;
  1000. },
  1001. handleConfirm() {
  1002. this.$refs["form"].validate(vaild => {
  1003. if (vaild) {
  1004. if (!this.form.fTruckno) return this.$message.error('车号不能为空')
  1005. for (let item in this.detailList) {
  1006. if (!this.detailList[item].fId) {
  1007. return this.$message.error('数据未保存,请先暂存')
  1008. }
  1009. }
  1010. let fPlanqty = 0;
  1011. let fPlannetweight = 0;
  1012. let fPlangrossweight = 0;
  1013. this.detailList.forEach(item => {
  1014. this.$set(item, 'fBsdate', this.form.fBsdate)
  1015. this.$set(item, 'fOriginalbillno', item.fMblno)
  1016. this.$set(item, 'fIsPass', 'T')
  1017. this.$set(item, 'fStltypeid', '1')
  1018. this.$set(item, 'fTruckno', this.form.fTruckno)
  1019. fPlanqty += Number(item.fQty)
  1020. fPlannetweight += Number(item.fNetweight)
  1021. fPlangrossweight += Number(item.fGrossweight)
  1022. delete item.deleteId
  1023. })
  1024. this.$set(this.form, 'fStltypeid', '1')
  1025. this.$set(this.form, 'fPlanqty', fPlanqty)
  1026. this.$set(this.form, 'fPlannetweight', fPlannetweight)
  1027. this.$set(this.form, 'fPlangrossweight', fPlangrossweight)
  1028. this.$set(this.form, 'fQty', fPlanqty)
  1029. this.$set(this.form, 'fNetweight', fPlannetweight)
  1030. this.$set(this.form, 'fGrossweight', fPlangrossweight)
  1031. this.$set(this.form, 'fChargedate', this.form.fBsdate)
  1032. let fProductName = []
  1033. this.detailList.map((e) => {
  1034. this.goodsOptions.map((item) => {
  1035. if (e.fGoodsid == item.fId) {
  1036. fProductName.push(item.fName);
  1037. }
  1038. });
  1039. });
  1040. fProductName = [...new Set(fProductName)];
  1041. // this.form.fProductName = fProductName.join(",");
  1042. this.$set(this.form, 'fProductName', fProductName.join(","))
  1043. let fMarks = []
  1044. this.detailList.map((e) => {
  1045. fMarks.push(e.fMarks);
  1046. });
  1047. fMarks = [...new Set(fMarks)];
  1048. // this.form.fMarks = fMarks.join(",");
  1049. this.$set(this.form, 'fMarks', fMarks.join(","))
  1050. let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
  1051. data = Object.assign({}, data, this.form)
  1052. this.loading = true
  1053. fastOutStock(data).then(res => {
  1054. this.$message.success('出库成功')
  1055. this.closeDialog()
  1056. this.loading = false
  1057. })
  1058. }
  1059. })
  1060. },
  1061. // 暂存
  1062. handleSave() {
  1063. if (!this.form.fTruckno) return this.$message.error('车号不能为空')
  1064. let fPlanqty = 0;
  1065. let fPlannetweight = 0;
  1066. let fPlangrossweight = 0;
  1067. this.detailList.forEach(item => {
  1068. this.$set(item, 'fBsdate', this.form.fBsdate)
  1069. this.$set(item, 'fOriginalbillno', item.fMblno)
  1070. this.$set(item, 'fIsPass', 'T')
  1071. this.$set(item, 'fStltypeid', '1')
  1072. this.$set(item, 'fTruckno', this.form.fTruckno)
  1073. fPlanqty += Number(item.fQty)
  1074. fPlannetweight += Number(item.fNetweight)
  1075. fPlangrossweight += Number(item.fGrossweight)
  1076. delete item.deleteId
  1077. })
  1078. this.$set(this.form, 'fStltypeid', '1')
  1079. this.$set(this.form, 'fPlanqty', fPlanqty)
  1080. this.$set(this.form, 'fPlannetweight', fPlannetweight)
  1081. this.$set(this.form, 'fPlangrossweight', fPlangrossweight)
  1082. this.$set(this.form, 'fQty', fPlanqty)
  1083. this.$set(this.form, 'fNetweight', fPlannetweight)
  1084. this.$set(this.form, 'fGrossweight', fPlangrossweight)
  1085. this.$set(this.form, 'fChargedate', this.form.fBsdate)
  1086. let fProductName = []
  1087. this.detailList.map((e) => {
  1088. this.goodsOptions.map((item) => {
  1089. if (e.fGoodsid == item.fId) {
  1090. fProductName.push(item.fName);
  1091. }
  1092. });
  1093. });
  1094. fProductName = [...new Set(fProductName)];
  1095. this.$set(this.form, 'fProductName', fProductName.join(","))
  1096. let fMarks = []
  1097. this.detailList.map((e) => {
  1098. fMarks.push(e.fMarks);
  1099. });
  1100. fMarks = [...new Set(fMarks)];
  1101. this.$set(this.form, 'fMarks', fMarks.join(","))
  1102. this.DrList.forEach(item => {
  1103. this.$set(item, 'fFeeunitid', Number(item.fFeeUnitid))
  1104. })
  1105. let data = {warehousebillsitemsList: this.detailList,warehousebillsfeesList: this.DrList}
  1106. data = Object.assign({}, data, this.form)
  1107. this.loading = true
  1108. saveOutstock(data).then(res => {
  1109. this.form = res.data
  1110. this.detailList = res.data.warehousebillsitemsList
  1111. this.DrList = res.data.warehousebillsfeesList
  1112. delete this.form.warehousebillsitemsList
  1113. delete this.form.warehousebillsfeesList
  1114. this.form.fBsdate = this.form.bsDate
  1115. this.form.fBstime = this.form.bsTime
  1116. this.detailList.forEach(item => {
  1117. item.fBusinessType = String(item.fBusinessType)
  1118. })
  1119. this.$message.success('暂存成功')
  1120. this.loading = false
  1121. })
  1122. },
  1123. addList() {
  1124. this.$refs["form"].validate(valid => {
  1125. if (valid) {
  1126. this.getDetailsList()
  1127. }
  1128. })
  1129. },
  1130. // 查询库存总账
  1131. getDetailsList() {
  1132. // this.detailList = []
  1133. this.disabled = true
  1134. let queryParams = {
  1135. fMblno: this.form.fMblno,
  1136. fCorpid: this.form.fCorpid,
  1137. fWarehouseid: this.form.fWarehouseid,
  1138. fTrademodeid: this.form.fTrademodeid
  1139. }
  1140. listWhgenleg(queryParams).then((response) => {
  1141. response.rows.map((e) => {
  1142. e.fQtyblc2 = e.fQtyblc;
  1143. e.fGrossweightblc2 = e.fGrossweightblc;
  1144. e.fNetweightblc2 = e.fNetweightblc;
  1145. });
  1146. // this.detailList = response.rows;
  1147. let arr = [];
  1148. response.rows.map(e => {
  1149. let index = this.detailList.findIndex(item => {
  1150. return item.fSrcid === e.fId
  1151. })
  1152. if (index == -1) {
  1153. arr.push({
  1154. fId: null,
  1155. fBsdate: this.form.fBsdate,
  1156. fMblno: e.fMblno,
  1157. fGoodsid: e.fGoodsid,
  1158. fCntrtype: null,
  1159. fPlanqty: e.fQtyblc,
  1160. fPlannetweight: e.fNetweightblc,
  1161. fPlangrossweight: e.fGrossweightblc,
  1162. fWarehouseLocationids: e.fWarehouseLocationids,
  1163. fGoodsids: e.fGoodsids,
  1164. fBillingway: e.fBillingway,
  1165. fChargedate: e.fChargedate,
  1166. fMarks: e.fMarks,
  1167. fOriginalbilldate: e.fOriginalbilldate,
  1168. fOriginalbillno: e.fOriginalbillno,
  1169. fPackagespecs: e.fPackagespecs,
  1170. fGrossweight: e.fGrossweightblc2,
  1171. fNetweight: e.fNetweightblc2,
  1172. fQty: e.fQtyblc2,
  1173. fCntqty: 1,
  1174. fBillstatus: 10,
  1175. fWarehouselocid: e.fWarehouseLocationid,
  1176. fWarehouselocids: e.fWarehouseLocationids,
  1177. fCntrno: e.fCntrno,
  1178. fGoodsval: null,
  1179. fTruckno: response.rows.fTruckno,
  1180. remark: null,
  1181. fIsPass: "T",
  1182. fDriverName: response.rows.fDriverName,
  1183. fDriverTel: response.rows.fDriverTel,
  1184. fDriverIdCar: response.rows.fDriverIdCar,
  1185. fBusinessType: e.fBusinessType ? e.fBusinessType.toString() : null,
  1186. fWarehouseInformation: e.fWarehouseids,
  1187. fSrcid: e.fId,
  1188. fSrcBsdate: e.fBsdate,
  1189. deleteId: e.fId,
  1190. })
  1191. }
  1192. })
  1193. this.detailList = this.detailList.concat(arr)
  1194. console.log(this.detailList)
  1195. this.disabled = false
  1196. });
  1197. },
  1198. // 新增应收明细
  1199. addDrList() {
  1200. this.$refs["form"].validate((valid) => {
  1201. if (valid) {
  1202. this.DrList.push({
  1203. fCorpid: this.form.fCorpid,
  1204. fMblno: this.form.fMblno,
  1205. fFeeid: null,
  1206. fFeeUnitid: null,
  1207. fQty: null,
  1208. fUnitprice: null,
  1209. fAmount: null,
  1210. fProductName: this.form.fProductName,
  1211. fMarks: this.form.fMarks,
  1212. fCurrency: "RMB",
  1213. fExrate: "1",
  1214. fTaxrate: null,
  1215. fCxrate: null,
  1216. fRate: null,
  1217. fStltypeid: '1',
  1218. fSrcTypeId: 0,
  1219. fBusinessType: '0',
  1220. remarks: null,
  1221. fDc: 'D',
  1222. })
  1223. }
  1224. })
  1225. },
  1226. changeFeeUnit() {},
  1227. // 修改毛重净重
  1228. changeOutStock(row) {
  1229. this.$refs['detailTable'].clearSelection()
  1230. let fNetweight = 0;
  1231. let fGrossweight = 0;
  1232. if (row.fNetweight) {
  1233. fNetweight = row.fNetweight;
  1234. }
  1235. if (row.fGrossweight) {
  1236. fGrossweight = row.fGrossweight;
  1237. }
  1238. if (row.fPlannetweight < fNetweight) {
  1239. this.$message({message: "出库净重超出结余净重", type: "warning"});
  1240. return false;
  1241. }
  1242. if (row.fPlangrossweight < fGrossweight) {
  1243. this.$message({message: "出库毛重超出结余毛重", type: "warning"});
  1244. return false;
  1245. }
  1246. },
  1247. // 出库件数的计算
  1248. qtyChange(row) {
  1249. if (row.fPlanqty < row.fQty) {
  1250. this.$message.error("出库件数超出结余件数!");
  1251. this.$set(row, "fQty", 0);
  1252. this.$set(row, "fNetweight", 0);
  1253. this.$set(row, "fGrossweight", 0);
  1254. return false;
  1255. }
  1256. if (row.fQtyblc2 > row.fQtyblc) {
  1257. this.$message.error("出库件数超出结余件数!");
  1258. this.$set(row, "fQtyblc2", 0);
  1259. this.$set(row, "fGrossweightblc2", 0);
  1260. this.$set(row, "fNetweightblc2", 0);
  1261. return false;
  1262. }
  1263. this.$set(
  1264. row,
  1265. "fNetweight",
  1266. parseFloat(
  1267. (Number(row.fPlannetweight) / Number(row.fPlanqty)) * Number(row.fQty)
  1268. ).toFixed(2)
  1269. );
  1270. this.$set(
  1271. row,
  1272. "fGrossweight",
  1273. parseFloat(
  1274. (Number(row.fPlangrossweight) / Number(row.fPlanqty)) *
  1275. Number(row.fQty)
  1276. ).toFixed(2)
  1277. );
  1278. this.$set(
  1279. row,
  1280. "fNetweightblc2",
  1281. parseFloat(
  1282. (Number(row.fNetweightblc) / Number(row.fQtyblc)) *
  1283. Number(row.fQtyblc2)
  1284. ).toFixed(2)
  1285. );
  1286. this.$set(
  1287. row,
  1288. "fGrossweightblc2",
  1289. parseFloat(
  1290. (Number(row.fGrossweightblc) / Number(row.fQtyblc)) *
  1291. Number(row.fQtyblc2)
  1292. ).toFixed(2)
  1293. );
  1294. },
  1295. // 明细删除
  1296. wDeleteRow(index, rows) {
  1297. rows.splice(index, 1);
  1298. },
  1299. // 批量删除
  1300. batchDelete() {
  1301. this.$confirm('是否确认删除选中数据', '提示', {
  1302. confirmButtonText: '确定',
  1303. cancelButtonText: '取消',
  1304. type: 'warning'
  1305. }).then(() => {
  1306. this.selection.forEach(item => {
  1307. console.log(item.deleteId)
  1308. let index = this.detailList.findIndex(item1 => {
  1309. return item1.deleteId == item.deleteId
  1310. })
  1311. this.detailList.splice(index, 1)
  1312. })
  1313. this.$message({
  1314. type: 'success',
  1315. message: '删除成功!'
  1316. });
  1317. }).catch(() => {
  1318. this.$message({
  1319. type: 'info',
  1320. message: '已取消删除'
  1321. });
  1322. });
  1323. },
  1324. changeMblno() {
  1325. if (this.detailList.length == 0) {
  1326. this.$set(this.form, "fCorpid", '')
  1327. this.$set(this.form, "fWarehouseid", '')
  1328. this.$set(this.form, "fGoodsid", '')
  1329. if (this.form.fMblno) {
  1330. let data = {
  1331. type: 'mblno',
  1332. fMblno: this.form.fMblno
  1333. }
  1334. changeSelect(data).then(res => {
  1335. this.fMblnoOptions = res.data.corpsList
  1336. this.warehouseOptions = res.data.warehouseList
  1337. this.goodsOptions = res.data.whgenlegVOList
  1338. if (this.fMblnoOptions.length > 0) {
  1339. this.form.fCorpid = this.fMblnoOptions[0].fId
  1340. let data1 = {
  1341. type: 'corp',
  1342. fMblno: this.form.fMblno,
  1343. corpId: this.form.fCorpid
  1344. }
  1345. changeSelect(data1).then(res => {
  1346. this.warehouseOptions = res.data.warehouseList
  1347. this.goodsOptions = res.data.whgenlegVOList
  1348. if (this.warehouseOptions.length > 0) {
  1349. this.form.fWarehouseid = this.warehouseOptions[0].fId
  1350. let data2 = {
  1351. type: 'warehouse',
  1352. fMblno: this.form.fMblno,
  1353. corpId: this.form.fCorpid,
  1354. warehouseId: this.form.fWarehouseid
  1355. }
  1356. changeSelect(data2).then(res => {
  1357. this.goodsOptions = res.data.goodsVOList
  1358. if (this.goodsOptions.length > 0) {
  1359. this.form.fGoodsid = this.goodsOptions[0].fId
  1360. }
  1361. })
  1362. }
  1363. })
  1364. }
  1365. })
  1366. } else {
  1367. listCorps({type: 1}).then((response) => {
  1368. this.fMblnoOptions = response.rows
  1369. })
  1370. listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
  1371. this.warehouseOptions = response.rows;
  1372. })
  1373. listGoods({fStatus: 0, delFlag: 0}).then((response) => {
  1374. this.goodsOptions = response.rows;
  1375. });
  1376. }
  1377. }
  1378. },
  1379. changeCorp() {
  1380. if (this.form.fMblno && this.form.fCorpid) {
  1381. this.$set(this.form, "fWarehouseid", '')
  1382. this.$set(this.form, "fGoodsid", '')
  1383. let data = {
  1384. type: 'corp',
  1385. fMblno: this.form.fMblno,
  1386. corpId: this.form.fCorpid
  1387. }
  1388. changeSelect(data).then(res => {
  1389. this.warehouseOptions = res.data.warehouseList
  1390. this.goodsOptions = res.data.whgenlegVOList
  1391. if (this.warehouseOptions.length > 0) {
  1392. this.form.fWarehouseid = this.warehouseOptions[0].fId
  1393. let data1 = {
  1394. type: 'warehouse',
  1395. fMblno: this.form.fMblno,
  1396. corpId: this.form.fCorpid,
  1397. warehouseId: this.form.fWarehouseid
  1398. }
  1399. changeSelect(data1).then(res => {
  1400. this.goodsOptions = res.data.goodsVOList
  1401. if (this.goodsOptions.length > 0) {
  1402. this.form.fGoodsid = this.goodsOptions[0].fId
  1403. }
  1404. })
  1405. }
  1406. })
  1407. } else if (this.form.fMblno && !this.form.fCorpid) {
  1408. this.$set(this.form, "fWarehouseid", '')
  1409. this.$set(this.form, "fGoodsid", '')
  1410. this.warehouseOptions = []
  1411. this.goodsOptions = []
  1412. }
  1413. },
  1414. changefWarehouseid() {
  1415. if (this.form.fMblno && this.form.fCorpid && this.form.fWarehouseid) {
  1416. this.$set(this.form, "fGoodsid", '')
  1417. let data = {
  1418. type: 'warehouse',
  1419. fMblno: this.form.fMblno,
  1420. corpId: this.form.fCorpid,
  1421. warehouseId: this.form.fWarehouseid
  1422. }
  1423. changeSelect(data).then(res => {
  1424. this.goodsOptions = res.data.goodsVOList
  1425. if (this.goodsOptions.length > 0) {
  1426. this.form.fGoodsid = this.goodsOptions[0].fId
  1427. }
  1428. })
  1429. } else if (this.form.fMblno && !this.form.fWarehouseid) {
  1430. this.$set(this.form, "fGoodsid", '')
  1431. this.goodsOptions = []
  1432. }
  1433. treeselect(this.form.fWarehouseid).then((response) => {
  1434. this.fWarehouseidOptions = response.data;
  1435. });
  1436. },
  1437. goodsChange(data) {
  1438. },
  1439. addprint(status) {
  1440. const style =
  1441. "@page { } " +
  1442. "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
  1443. if (status == 'ckd') {
  1444. print({
  1445. printable: "print_ckd",
  1446. type: "html",
  1447. style: style, // 亦可使用引入的外部css;
  1448. scanStyles: false,
  1449. });
  1450. }
  1451. },
  1452. // 合计
  1453. getSummaries(param) {
  1454. const {columns, data} = param;
  1455. const sums = [];
  1456. var values = [];
  1457. columns.forEach((column, index) => {
  1458. if (index === 0) {
  1459. sums[index] = "";
  1460. return;
  1461. }
  1462. if (column.property === "fGrossweight") {
  1463. values = data.map((item) => Number(item["fGrossweight"]));
  1464. }
  1465. if (column.property === "fNetweight") {
  1466. values = data.map((item) => Number(item["fNetweight"]));
  1467. }
  1468. if (column.property === "fQty") {
  1469. values = data.map((item) => Number(item["fQty"]));
  1470. }
  1471. if (column.property === "fCntqty") {
  1472. values = data.map((item) => Number(item["fCntqty"]));
  1473. }
  1474. if (
  1475. column.property === "fGrossweight" ||
  1476. column.property === "fNetweight" ||
  1477. column.property === "fQty" ||
  1478. column.property === "fCntqty"
  1479. ) {
  1480. sums[index] = values.reduce((prev, curr) => {
  1481. const value = Number(curr);
  1482. if (!isNaN(value)) {
  1483. if (column.property === "fGrossweight") {
  1484. this.fGrossweight = prev + curr;
  1485. }
  1486. if (column.property === "fNetweight") {
  1487. this.fNetweight = prev + curr;
  1488. }
  1489. if (column.property === "fQty") {
  1490. this.fQty = prev + curr;
  1491. this.sumMum = prev + curr;
  1492. }
  1493. if (column.property === "fCntqty") {
  1494. this.fCntqty = prev + curr;
  1495. }
  1496. return prev + curr;
  1497. } else {
  1498. return prev;
  1499. }
  1500. }, 0);
  1501. if (column.property === "fGrossweight") {
  1502. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  1503. } else if (column.property === "fNetweight") {
  1504. sums[index] = (sums[index] / 1000).toFixed(4) + "吨";
  1505. } else {
  1506. // sums[index] = sums[index].toFixed(2);
  1507. sums[index] = sums[index]
  1508. }
  1509. }
  1510. });
  1511. this.sums = sums;
  1512. return sums;
  1513. },
  1514. // 数量计算
  1515. changeContractAmt(row) {
  1516. let fQty = 0;
  1517. let fUnitprice = 0;
  1518. if (row.fUnitprice) {
  1519. fUnitprice = row.fUnitprice;
  1520. }
  1521. if (row.fQty) {
  1522. fQty = row.fQty;
  1523. }
  1524. this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
  1525. },
  1526. // 收费明细删除
  1527. deleteDrRow(index, rows) {
  1528. rows.splice(index, 1);
  1529. },
  1530. // 费用明细请核
  1531. listCheck(row) {
  1532. feesCheck(row.fId).then(res => {
  1533. this.$message.success('请核成功')
  1534. res.data.fFeeUnitid = res.data.fFeeunitid.toString();
  1535. if (res.data.fDc == 'D') {
  1536. let index = this.DrList.findIndex(item => item.fId == res.data.fId)
  1537. this.DrList.splice(index, 1, res.data)
  1538. } else {
  1539. // let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
  1540. // this.warehouseCrList.splice(index, 1, res.data)
  1541. }
  1542. })
  1543. },
  1544. // 费用明细撤销请核
  1545. revokeListCheck(row) {
  1546. revokefeeCheck(row.fId).then(res => {
  1547. res.data.fFeeUnitid = res.data.fFeeunitid.toString();
  1548. this.$message.success('操作成功')
  1549. if (res.data.fDc == 'D') {
  1550. let index = this.DrList.findIndex(item => item.fId == res.data.fId)
  1551. this.DrList.splice(index, 1, res.data)
  1552. } else {
  1553. // let index = this.warehouseCrList.findIndex(item => item.fId == res.data.fId)
  1554. // this.warehouseCrList.splice(index, 1, res.data)
  1555. }
  1556. })
  1557. },
  1558. //列设置全选
  1559. allChecked() {
  1560. if (this.allCheck == true) {
  1561. this.setRowList.map((e) => {
  1562. return (e.checked = 0);
  1563. });
  1564. } else {
  1565. this.setRowList.map((e) => {
  1566. return (e.checked = 1);
  1567. });
  1568. }
  1569. },
  1570. //开始拖拽事件
  1571. onStart() {
  1572. this.drag = true;
  1573. },
  1574. //拖拽结束事件
  1575. onEnd() {
  1576. this.drag = false;
  1577. },
  1578. //重置列表
  1579. delRow() {
  1580. this.data = {
  1581. tableName: "快速出库明细",
  1582. userId: Cookies.get("userName"),
  1583. };
  1584. resetModule(this.data).then((res) => {
  1585. if (res.code == 200) {
  1586. this.showSetting = false;
  1587. this.setRowList = this.tableDate;
  1588. console.log(this.setRowList)
  1589. this.getRowList = this.tableDate;
  1590. }
  1591. });
  1592. },
  1593. //保存列设置
  1594. save() {
  1595. this.showSetting = false;
  1596. this.data = {
  1597. tableName: "快速出库明细",
  1598. userId: Cookies.get("userName"),
  1599. sysTableSetList: this.setRowList,
  1600. };
  1601. addSet(this.data).then((res) => {
  1602. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1603. });
  1604. },
  1605. //查询列数据
  1606. getRow() {
  1607. let that = this;
  1608. this.data = {
  1609. tableName: "快速出库明细",
  1610. userId: Cookies.get("userName"),
  1611. };
  1612. select(this.data).then((res) => {
  1613. if (res.data.length != 0) {
  1614. this.getRowList = res.data.filter((e) => e.checked == 0);
  1615. this.setRowList = res.data;
  1616. this.setRowList = this.setRowList.reduce((res, item) => {
  1617. res.push({
  1618. surface: item.surface,
  1619. label: item.label,
  1620. name: item.name,
  1621. checked: item.checked,
  1622. width: item.width,
  1623. fixed: item.fixed,
  1624. });
  1625. return res;
  1626. }, []);
  1627. }
  1628. });
  1629. },
  1630. },
  1631. }
  1632. </script>
  1633. <style scoped lang="scss">
  1634. .print-div {
  1635. color: #000;
  1636. }
  1637. .print_table {
  1638. table {
  1639. border-right: 1px solid #000;
  1640. border-bottom: 1px solid #000;
  1641. font-size: 12px;
  1642. margin-bottom: 5px;
  1643. }
  1644. table td {
  1645. border-left: 1px solid #000;
  1646. border-top: 1px solid #000;
  1647. vertical-align: middle;
  1648. padding: 2px;
  1649. text-align: center;
  1650. }
  1651. }
  1652. .print_form {
  1653. font-size: 12px;
  1654. }
  1655. /deep/ .el-tabs .el-tabs__content {
  1656. overflow-x: visible !important;
  1657. }
  1658. </style>