index.vue 48 KB

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