index.vue 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261
  1. <template>
  2. <!-- 仓储费计算列表 + 弹窗页面 -->
  3. <div class="app-container">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="88px"
  10. >
  11. <el-form-item label="业务编号" prop="fBillno">
  12. <el-input
  13. v-model="queryParams.fBillno"
  14. placeholder="请输入业务编号"
  15. clearable
  16. style="width: 200px"
  17. size="small"
  18. @keyup.enter.native="handleQuery"
  19. />
  20. </el-form-item>
  21. <el-form-item label="制单人" prop="createBy">
  22. <el-select
  23. v-model="queryParams.createBy"
  24. filterable
  25. remote
  26. clearable
  27. style="width: 200px"
  28. :remote-method="userRemoteMethod"
  29. placeholder="请选择制单人"
  30. >
  31. <el-option
  32. v-for="(dict, index) in userOptions"
  33. :key="index.userName"
  34. :label="dict.nickName"
  35. :value="dict.userName"
  36. ></el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item label="货权方" prop="fCorpid">
  40. <el-select
  41. v-model="queryParams.fCorpid"
  42. filterable
  43. remote
  44. clearable
  45. style="width: 200px"
  46. @keyup.enter.native="handleQuery"
  47. :remote-method="corpsRemoteMethod"
  48. placeholder="请选择货权方"
  49. >
  50. <el-option
  51. v-for="(dict, index) in fMblnoOptions"
  52. :key="index.fId"
  53. :label="dict.fName"
  54. :value="dict.fId"
  55. ></el-option>
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item label="提单号" prop="fMblno">
  59. <el-input
  60. v-model="queryParams.fMblno"
  61. placeholder="请输入提单号"
  62. clearable
  63. size="small"
  64. @keyup.enter.native="handleQuery"
  65. />
  66. </el-form-item>
  67. <el-form-item label="唛头" prop="fMarks">
  68. <el-input
  69. v-model="queryParams.fMarks"
  70. placeholder="请输入唛头"
  71. clearable
  72. size="small"
  73. style="width: 200px"
  74. @keyup.enter.native="handleQuery"
  75. />
  76. </el-form-item>
  77. <el-form-item label="单据状态" prop="fBillstatus">
  78. <el-select
  79. style="width:200px"
  80. v-model="queryParams.fBillstatus"
  81. placeholder="请输入单据状态"
  82. >
  83. <el-option label="新建" value="1"></el-option>
  84. <el-option label="暂存" value="2"></el-option>
  85. <el-option label="审核驳回" value="3"></el-option>
  86. <el-option label="提交审核" value="4"></el-option>
  87. <el-option label="审核中" value="5"></el-option>
  88. <el-option label="审核通过" value="6"></el-option>
  89. </el-select>
  90. </el-form-item>
  91. <el-form-item label="出库日期" prop="timeInterval">
  92. <el-date-picker
  93. v-model="queryParams.timeInterval"
  94. type="daterange"
  95. value-format="yyyy-MM-dd"
  96. clearable
  97. style="width: 240px"
  98. range-separator="至"
  99. start-placeholder="开始日期"
  100. end-placeholder="结束日期"
  101. @keyup.enter.native="handleQuery"
  102. >
  103. </el-date-picker>
  104. </el-form-item>
  105. <el-form-item>
  106. <el-button
  107. type="cyan"
  108. icon="el-icon-search"
  109. size="mini"
  110. @click="handleQuery"
  111. >搜索
  112. </el-button>
  113. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  114. >重置
  115. </el-button>
  116. </el-form-item>
  117. </el-form>
  118. <el-row :gutter="10" class="mb8">
  119. <el-col :span="1.5">
  120. <el-button
  121. type="primary"
  122. icon="el-icon-plus"
  123. size="mini"
  124. @click="handleAdd(false)"
  125. v-hasPermi="['warehouseBusiness:storageFeeCalculation:add']"
  126. >新增
  127. </el-button>
  128. </el-col>
  129. <el-col :span="1.5">
  130. <el-button
  131. type="success"
  132. icon="el-icon-edit"
  133. size="mini"
  134. :disabled="single"
  135. @click="handleUpdate"
  136. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  137. >修改
  138. </el-button>
  139. </el-col>
  140. <el-col :span="1.5">
  141. <el-button
  142. type="danger"
  143. icon="el-icon-delete"
  144. size="mini"
  145. :disabled="multiple"
  146. @click="handleDelete"
  147. v-hasPermi="['warehouseBusiness:storageFeeCalculation:remove']"
  148. >删除
  149. </el-button>
  150. </el-col>
  151. <el-col :span="1.5">
  152. <el-button
  153. type="warning"
  154. icon="el-icon-download"
  155. size="mini"
  156. @click="handleExport"
  157. v-hasPermi="['warehouseBusiness:storageFeeCalculation:export']"
  158. >导出
  159. </el-button>
  160. </el-col>
  161. <el-col :span="1.5">
  162. <el-button
  163. type="warning"
  164. icon="el-icon-download"
  165. size="mini"
  166. @click="handleExport"
  167. :disabled="multiple"
  168. v-hasPermi="['warehouseBusiness:storageFeeCalculation:export']"
  169. >导入
  170. </el-button>
  171. </el-col>
  172. <div class="tabSetting">
  173. <right-toolbar
  174. :showSearch.sync="showSearch"
  175. @queryTable="getList"
  176. ></right-toolbar>
  177. <div style="margin: 0 12px">
  178. <el-button
  179. icon="el-icon-setting"
  180. size="mini"
  181. circle
  182. @click="showSetting = !showSetting"
  183. ></el-button>
  184. </div>
  185. </div>
  186. </el-row>
  187. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px" v-dialogDrag>
  188. <template slot="title">
  189. <div class="avue-crud__dialog__header">
  190. <span class="el-dialog__title">
  191. <span
  192. style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  193. </span>
  194. </div>
  195. </template>
  196. <div>配置排序列数据(拖动调整顺序)</div>
  197. <div style="margin-left: 17px">
  198. <el-checkbox
  199. v-model="allCheck"
  200. label="全选"
  201. @change="allChecked"
  202. ></el-checkbox>
  203. </div>
  204. <div style="padding: 4px; display: flex; justify-content: center">
  205. <draggable
  206. v-model="setRowList"
  207. group="site"
  208. animation="300"
  209. @start="onStart"
  210. @end="onEnd"
  211. handle=".indraggable"
  212. >
  213. <transition-group>
  214. <div
  215. v-for="item in setRowList"
  216. :key="item.surface"
  217. class="listStyle"
  218. >
  219. <div style="width: 500px" class="indraggable">
  220. <div class="progress" :style="{ width: item.width + 'px' }">
  221. <el-checkbox
  222. :label="item.name"
  223. v-model="item.checked"
  224. :true-label="0"
  225. :false-label="1"
  226. >{{ item.name }}
  227. </el-checkbox>
  228. </div>
  229. </div>
  230. <el-input-number
  231. v-model.number="item.width"
  232. controls-position="right"
  233. :min="1"
  234. :max="500"
  235. size="mini"
  236. ></el-input-number>
  237. </div>
  238. </transition-group>
  239. </draggable>
  240. </div>
  241. <span slot="footer" class="dialog-footer">
  242. <el-button @click="showSetting = false">取 消</el-button>
  243. <el-button type="primary" @click="save()">确 定</el-button>
  244. </span>
  245. </el-dialog>
  246. <el-table
  247. v-loading="loading"
  248. :data="warehousebillsList"
  249. @selection-change="handleSelectionChange"
  250. ref="table"
  251. :height="tableHeight"
  252. >
  253. <el-table-column type="selection" width="55" align="center"/>
  254. <el-table-column type="index" label="行号" align="center"/>
  255. <el-table-column
  256. :show-overflow-tooltip="true"
  257. label="单据编号"
  258. align="center"
  259. width="160"
  260. prop="fBillno"
  261. />
  262. <el-table-column label="客户名称" align="center" width="300" sortable prop="fCorpid" show-overflow-tooltip/>
  263. <el-table-column
  264. label="计费日期"
  265. align="center"
  266. sortable
  267. prop="fBillingDeadline"
  268. width="180"
  269. >
  270. <template slot-scope="scope">
  271. <span>{{ parseTime(scope.row.fBillingDeadline, "{y}-{m}-{d}") }}</span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column
  275. label="备注"
  276. align="center"
  277. prop="remark"
  278. />
  279. <el-table-column
  280. label="单据状态"
  281. align="center"
  282. sortable
  283. prop="fBillstatus"
  284. >
  285. <!-- <template slot-scope="scope">
  286. <span v-if="scope.row.fBillstatus === 1">新建</span>
  287. <span v-if="scope.row.fBillstatus === 2">暂存</span>
  288. <span v-if="scope.row.fBillstatus === 3">审核驳回</span>
  289. <span v-if="scope.row.fBillstatus === 4">提交审核</span>
  290. <span v-if="scope.row.fBillstatus === 5">审核中</span>
  291. <span v-if="scope.row.fBillstatus === 6">审核通过</span>
  292. </template>-->
  293. </el-table-column>
  294. <el-table-column
  295. label="制单人"
  296. align="center"
  297. prop="createBy"
  298. />
  299. <el-table-column
  300. label="制单日期"
  301. align="center"
  302. prop="createTime"
  303. width="160"
  304. >
  305. <template slot-scope="scope">
  306. {{ scope.row.createTime.slice(0, 10) }}
  307. </template>
  308. </el-table-column>
  309. <el-table-column
  310. label="操作"
  311. align="center"
  312. class-name="small-padding fixed-width"
  313. min-width="180"
  314. >
  315. <template slot-scope="scope">
  316. <el-button
  317. size="mini"
  318. type="text"
  319. icon="el-icon-edit"
  320. @click="handleUpdate_s(scope.row, true)"
  321. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  322. >查看
  323. </el-button>
  324. <el-button
  325. size="mini"
  326. type="text"
  327. icon="el-icon-view"
  328. @click="handleUpdate(scope.row, true)"
  329. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  330. v-if="scope.row.fBillstatus == '请核' || scope.row.fBillstatus == '审核中' "
  331. >审批进度
  332. </el-button
  333. >
  334. <el-button
  335. size="mini"
  336. type="text"
  337. icon="el-icon-edit"
  338. v-if="
  339. scope.row.fBillstatus == '录入' ||
  340. scope.row.fBillstatus == '暂存' ||
  341. scope.row.fBillstatus == '驳回'
  342. "
  343. @click="handleUpdate(scope.row, false)"
  344. v-hasPermi="['warehouseBusiness:storageFeeCalculation:edit']"
  345. >修改
  346. </el-button>
  347. <el-button
  348. size="mini"
  349. type="text"
  350. icon="el-icon-delete"
  351. v-if="
  352. scope.row.fBillstatus == '录入' ||
  353. scope.row.fBillstatus == '暂存' ||
  354. scope.row.fBillstatus == '驳回'
  355. "
  356. @click="handleDelete(scope.row)"
  357. v-hasPermi="['warehouseBusiness:storageFeeCalculation:remove']"
  358. >删除
  359. </el-button>
  360. </template>
  361. </el-table-column>
  362. </el-table>
  363. <pagination
  364. v-show="total > 0"
  365. :total="total"
  366. :page.sync="queryParams.pageNum"
  367. :limit.sync="queryParams.pageSize"
  368. @pagination="getList"
  369. />
  370. <!-- 新增或修改仓储费计算对话框 -->
  371. <el-dialog
  372. v-dialogDrag
  373. :fullscreen="dialogFull"
  374. :visible.sync="open"
  375. :close-on-click-modal="false"
  376. width="80%"
  377. append-to-body
  378. :show-close="Xbutton"
  379. >
  380. <template slot="title">
  381. <div class="avue-crud__dialog__header">
  382. <span class="el-dialog__title">
  383. <span
  384. style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  385. </span>
  386. <div class="avue-crud__dialog__menu enlarge" @click="full">
  387. <i style="cursor: pointer;display: block;width:12px;height:12px;border:1px solid #909399;border-top:3px solid #909399;margin-top: -3px;"></i>
  388. </div>
  389. </div>
  390. </template>
  391. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  392. <el-row>
  393. <el-col :span="8">
  394. <el-form-item label="客户名称" prop="fCorpid">
  395. <el-select
  396. v-model="form.fCorpid"
  397. filterable
  398. remote
  399. :disabled="browseStatus"
  400. style="width:80%"
  401. :remote-method="corpsRemoteMethod"
  402. placeholder="请输入模糊查找客户名称"
  403. >
  404. <el-option
  405. v-for="(dict, index) in fMblnoOptions"
  406. :key="index.fId"
  407. :label="dict.fName"
  408. :value="dict.fId"
  409. ></el-option>
  410. </el-select>
  411. </el-form-item>
  412. </el-col>
  413. <el-col :span="8">
  414. <el-form-item label="货品名称" prop="fGoodsid">
  415. <el-select
  416. v-model="form.fGoodsid"
  417. filterable
  418. style="width:80%"
  419. :disabled="browseStatus"
  420. remote
  421. :remote-method="goodsRemoteMethod"
  422. placeholder="请输入模糊查找货品名称"
  423. >
  424. <el-option
  425. v-for="(dict, index) in goodsOptions"
  426. :key="index.fId"
  427. :label="dict.fName"
  428. :value="dict.fId"
  429. ></el-option>
  430. </el-select>
  431. </el-form-item>
  432. </el-col>
  433. <el-col :span="8">
  434. <el-form-item label="提单号" prop="fMblno">
  435. <el-input
  436. v-model="form.fMblno"
  437. style="width:80%"
  438. :disabled="browseStatus"
  439. placeholder="手工输入"
  440. />
  441. </el-form-item>
  442. </el-col>
  443. </el-row>
  444. <el-row>
  445. <el-col :span="8">
  446. <el-form-item disabled label="仓储费截止日期" prop="fBillingDeadline">
  447. <el-date-picker
  448. v-model="form.fBillingDeadline"
  449. size="large"
  450. type="date"
  451. style="width:80%"
  452. :disabled="browseStatus"
  453. value-format="timestamp"
  454. placeholder="仓储费计算截止日期"
  455. >
  456. </el-date-picker>
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="8">
  460. <el-form-item label="业务编号" prop="fBillno">
  461. <el-input
  462. disabled
  463. v-model="form.fBillno"
  464. style="width:80%"
  465. placeholder="业务编号"
  466. />
  467. </el-form-item>
  468. </el-col>
  469. <!-- <el-col :span="8">-->
  470. <!-- <el-form-item label="仓储费方式" prop="fChargetype">-->
  471. <!-- <span>-->
  472. <!-- <el-select v-model="form.fChargetype" slot="prepend" :disabled="browseStatus" placeholder="请选择" style="width:80%">-->
  473. <!-- <el-option label="实际入库日期" value="0"></el-option>-->
  474. <!-- <el-option label="最早入库日期" value="1"></el-option>-->
  475. <!-- </el-select>-->
  476. <!-- </span>-->
  477. <!-- </el-form-item>-->
  478. <!-- </el-col>-->
  479. <!-- <el-col :span="8">-->
  480. <!-- <el-form-item label="仓储费方式" prop="fChargetype">-->
  481. <!-- <span>-->
  482. <!-- <el-select v-model="form.fChargetype" slot="prepend" :disabled="browseStatus" placeholder="请选择" style="width:80%">-->
  483. <!-- <el-option label="实际入库日期" value="0"></el-option>-->
  484. <!-- <el-option label="最早入库日期" value="1"></el-option>-->
  485. <!-- </el-select>-->
  486. <!-- </span>-->
  487. <!-- </el-form-item>-->
  488. <!-- </el-col>-->
  489. </el-row>
  490. <el-row>
  491. <el-col :span="8">
  492. <el-form-item label="制单人" prop="createBy">
  493. <el-input
  494. disabled
  495. v-model="form.createBy"
  496. style="width:80%"
  497. placeholder="制单人"
  498. />
  499. </el-form-item>
  500. </el-col>
  501. </el-row>
  502. <el-row>
  503. <el-col :span="8">
  504. <el-form-item disabled label="制单日期" prop="fbilldate">
  505. <el-date-picker
  506. v-model="form.createTime"
  507. size="large"
  508. type="date"
  509. disabled
  510. style="width:80%"
  511. value-format="timestamp"
  512. placeholder="制单日期"
  513. >
  514. </el-date-picker>
  515. </el-form-item>
  516. </el-col>
  517. <el-col :span="8">
  518. <el-form-item disabled label="备注" prop="remark">
  519. <el-input
  520. style="width:80%"
  521. :disabled="browseStatus"
  522. v-model="form.remark"
  523. placeholder="请输入备注"
  524. />
  525. </el-form-item>
  526. </el-col>
  527. </el-row>
  528. </el-form>
  529. <div style="font-size:18px; padding-top:8px">
  530. 计费物资明细
  531. <el-button :disabled="browseStatus" @click="calculateCost">计算仓储费</el-button>
  532. <el-button type="primary" :disabled="browseStatus" @click="submitForm(2)">保 存</el-button>
  533. <el-button
  534. type="warning"
  535. icon="el-icon-download"
  536. @click="handleExportItems"
  537. >导出
  538. </el-button>
  539. </div>
  540. <div class="dialogTableTitle flex a-center jlr"
  541. style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">
  542. <el-table
  543. :data="dataList"
  544. ref="tableList"
  545. tooltip-effect="dark"
  546. border
  547. stripe
  548. :summary-method="getSummaries"
  549. show-summary
  550. >
  551. <el-table-column label="序号" type="index" width="80">
  552. </el-table-column>
  553. <el-table-column
  554. prop="fBilltype"
  555. header-align="center"
  556. align="center"
  557. width="140px"
  558. label="业务来源"
  559. >
  560. <template slot-scope="scope">
  561. <span v-if="scope.row.fBilltype === 'SJRK'">入库</span>
  562. <span v-if="scope.row.fBilltype === 'SJCK'">出库</span>
  563. <span v-if="scope.row.fBilltype === 'KCZZ'">库存总账</span>
  564. </template>
  565. </el-table-column>
  566. <el-table-column
  567. prop="fMblno"
  568. header-align="center"
  569. align="center"
  570. width="140px"
  571. label="业务单号"
  572. >
  573. </el-table-column>
  574. <el-table-column
  575. prop="fProductName"
  576. header-align="center"
  577. align="center"
  578. width="140px"
  579. label="货物名称"
  580. >
  581. </el-table-column>
  582. <el-table-column
  583. prop="fMarks"
  584. header-align="center"
  585. align="center"
  586. width="140px"
  587. label="唛头"
  588. />
  589. <el-table-column
  590. prop="fBsdate"
  591. header-align="center"
  592. align="center"
  593. width="140px"
  594. label="业务日期"
  595. >
  596. <template slot-scope="scope">
  597. <el-date-picker
  598. v-model="scope.row.fBsdate"
  599. size="large"
  600. type="date"
  601. disabled
  602. value-format="timestamp"
  603. placeholder="业务日期"
  604. >
  605. </el-date-picker>
  606. </template>
  607. </el-table-column>
  608. <el-table-column
  609. prop="fBillingway"
  610. header-align="center"
  611. align="center"
  612. width="180px"
  613. label="计费单位"
  614. >
  615. <template slot-scope="scope">
  616. <el-select
  617. v-model="scope.row.fBillingway"
  618. placeholder="请选择计费单位"
  619. disabled
  620. clearable
  621. >
  622. <el-option
  623. v-for="dict in fFeetunitOptions"
  624. :key="dict.dictValue"
  625. :label="dict.dictLabel"
  626. :value="dict.dictValue"
  627. />
  628. </el-select>
  629. </template>
  630. </el-table-column>
  631. <el-table-column
  632. prop="fBillingQty"
  633. header-align="center"
  634. align="center"
  635. width="140px"
  636. label="计费数量"
  637. >
  638. </el-table-column>
  639. <el-table-column
  640. prop="fChargedate"
  641. header-align="center"
  642. align="center"
  643. width="140px"
  644. label="计费起始日期"
  645. >
  646. <template slot-scope="scope">
  647. <el-date-picker
  648. v-model="scope.row.fChargedate"
  649. size="large"
  650. type="date"
  651. disabled
  652. value-format="timestamp"
  653. placeholder="计费起始日期"
  654. >
  655. </el-date-picker>
  656. </template>
  657. </el-table-column>
  658. <el-table-column
  659. prop="fBillingDeadline"
  660. header-align="center"
  661. align="center"
  662. width="140px"
  663. label="计费截止日期"
  664. >
  665. <template slot-scope="scope">
  666. <el-date-picker
  667. v-model="scope.row.fBillingDeadline"
  668. size="large"
  669. type="date"
  670. disabled
  671. value-format="timestamp"
  672. placeholder="计费截止日期"
  673. >
  674. </el-date-picker>
  675. </template>
  676. </el-table-column>
  677. <el-table-column
  678. prop="fBillingDays"
  679. header-align="center"
  680. align="center"
  681. width="140px"
  682. label="计费天数"
  683. >
  684. </el-table-column>
  685. <el-table-column
  686. prop="fInventoryDays"
  687. header-align="center"
  688. align="center"
  689. width="140px"
  690. label="库存天数"
  691. >
  692. </el-table-column>
  693. <el-table-column
  694. prop="fAmt"
  695. header-align="center"
  696. align="center"
  697. width="140px"
  698. label="计费金额"
  699. >
  700. </el-table-column>
  701. <el-table-column
  702. prop="remark"
  703. header-align="center"
  704. width="150px"
  705. align="center"
  706. label="备注"
  707. >
  708. <template slot-scope="scope">
  709. <el-input
  710. v-model="scope.row.remark"
  711. placeholder="备注"
  712. :disabled="browseStatus"
  713. show-word-limit
  714. />
  715. </template>
  716. </el-table-column>
  717. <el-table-column
  718. header-align="center"
  719. align="center"
  720. label="操作"
  721. width="130PX"
  722. >
  723. <template slot-scope="scope">
  724. <el-button
  725. @click.native.prevent="
  726. deleteRow(scope.$index, dataList)
  727. "
  728. :disabled="browseStatus"
  729. size="small"
  730. >移除
  731. </el-button>
  732. </template>
  733. </el-table-column>
  734. </el-table>
  735. </div>
  736. <!-- <div>-->
  737. <!-- <el-button :disabled="browseStatus" @click.prevent="addCollection()"-->
  738. <!-- >新行-->
  739. <!-- </el-button>-->
  740. <!-- <el-button type="primary" :disabled="browseStatus" @click="submitForm(2)">保 存</el-button>-->
  741. <!-- </div>-->
  742. <!-- <div style="font-size:18px">应收款明细</div>-->
  743. <!-- <div class="dialogTableTitle flex a-center jlr"-->
  744. <!-- style="display:flex;justify-content:space-between;align-items:center;margin: 10px 0;">-->
  745. <!-- <el-table-->
  746. <!-- :data="warehouseDrList"-->
  747. <!-- ref="table"-->
  748. <!-- tooltip-effect="dark"-->
  749. <!-- border-->
  750. <!-- stripe-->
  751. <!-- show-summary-->
  752. <!-- :summary-method="warehouseDrSummaries"-->
  753. <!-- >-->
  754. <!-- <el-table-column label="序号" type="index" width="80">-->
  755. <!-- </el-table-column>-->
  756. <!-- <el-table-column-->
  757. <!-- prop="fCorpid"-->
  758. <!-- header-align="center"-->
  759. <!-- align="center"-->
  760. <!-- width="180px"-->
  761. <!-- label="客户名称"-->
  762. <!-- >-->
  763. <!-- <template slot-scope="scope">-->
  764. <!-- <el-select-->
  765. <!-- v-model="scope.row.fCorpid"-->
  766. <!-- filterable-->
  767. <!-- remote-->
  768. <!-- :disabled="browseStatus"-->
  769. <!-- :remote-method="corpsRemoteMethod"-->
  770. <!-- placeholder="客户名称"-->
  771. <!-- >-->
  772. <!-- <el-option-->
  773. <!-- v-for="(dict, index) in fMblnoOptions"-->
  774. <!-- :key="index.fId"-->
  775. <!-- :label="dict.fName"-->
  776. <!-- :value="dict.fId"-->
  777. <!-- ></el-option>-->
  778. <!-- </el-select>-->
  779. <!-- </template>-->
  780. <!-- </el-table-column>-->
  781. <!-- <el-table-column-->
  782. <!-- prop="fFeeid"-->
  783. <!-- header-align="center"-->
  784. <!-- align="center"-->
  785. <!-- width="180px"-->
  786. <!-- label="费用名称"-->
  787. <!-- >-->
  788. <!-- <template slot-scope="scope">-->
  789. <!-- <el-select-->
  790. <!-- v-model="scope.row.fFeeid"-->
  791. <!-- filterable-->
  792. <!-- remote-->
  793. <!-- :disabled="browseStatus"-->
  794. <!-- :remote-method="fWRemoteMethod"-->
  795. <!-- placeholder="费用名称"-->
  796. <!-- >-->
  797. <!-- <el-option-->
  798. <!-- v-for="dict in fWbuOptions"-->
  799. <!-- :key="dict.fId"-->
  800. <!-- :label="dict.fName"-->
  801. <!-- :value="dict.fId"-->
  802. <!-- ></el-option>-->
  803. <!-- </el-select>-->
  804. <!-- </template>-->
  805. <!-- </el-table-column>-->
  806. <!-- <el-table-column-->
  807. <!-- prop="fFeeunitid"-->
  808. <!-- header-align="center"-->
  809. <!-- align="center"-->
  810. <!-- width="180px"-->
  811. <!-- label="计价单位"-->
  812. <!-- >-->
  813. <!-- <template slot-scope="scope">-->
  814. <!-- <el-select-->
  815. <!-- v-model="scope.row.fFeeunitid"-->
  816. <!-- placeholder="请选择计价单位"-->
  817. <!-- :disabled="browseStatus"-->
  818. <!-- clearable-->
  819. <!-- >-->
  820. <!-- <el-option-->
  821. <!-- v-for="dict in fFeetunitOptions"-->
  822. <!-- :key="dict.dictValue"-->
  823. <!-- :label="dict.dictLabel"-->
  824. <!-- :value="dict.dictValue"-->
  825. <!-- />-->
  826. <!-- </el-select>-->
  827. <!-- </template>-->
  828. <!-- </el-table-column>-->
  829. <!-- <el-table-column-->
  830. <!-- prop="fQty"-->
  831. <!-- header-align="center"-->
  832. <!-- align="center"-->
  833. <!-- width="150px"-->
  834. <!-- label="数量"-->
  835. <!-- >-->
  836. <!-- <template slot-scope="scope">-->
  837. <!-- <el-input-->
  838. <!-- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'-->
  839. <!-- v-model="scope.row.fQty"-->
  840. <!-- @change="changeEstmateAmt(scope.row)"-->
  841. <!-- :disabled="browseStatus"-->
  842. <!-- placeholder="数量"-->
  843. <!-- show-word-limit-->
  844. <!-- />-->
  845. <!-- </template>-->
  846. <!-- </el-table-column>-->
  847. <!-- <el-table-column-->
  848. <!-- prop="fUnitprice"-->
  849. <!-- header-align="center"-->
  850. <!-- align="center"-->
  851. <!-- width="150px"-->
  852. <!-- label="单价"-->
  853. <!-- >-->
  854. <!-- <template slot-scope="scope">-->
  855. <!-- <el-input-->
  856. <!-- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'-->
  857. <!-- v-model="scope.row.fUnitprice"-->
  858. <!-- @change="changeEstmateAmt(scope.row)"-->
  859. <!-- :disabled="browseStatus"-->
  860. <!-- placeholder="单价"-->
  861. <!-- show-word-limit-->
  862. <!-- />-->
  863. <!-- </template>-->
  864. <!-- </el-table-column>-->
  865. <!-- <el-table-column-->
  866. <!-- prop="fAmount"-->
  867. <!-- header-align="center"-->
  868. <!-- align="center"-->
  869. <!-- width="150px"-->
  870. <!-- label="金额"-->
  871. <!-- >-->
  872. <!-- <template slot-scope="scope">-->
  873. <!-- <el-input-->
  874. <!-- disabled-->
  875. <!-- oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'-->
  876. <!-- v-model="scope.row.fAmount"-->
  877. <!-- placeholder="金额"-->
  878. <!-- show-word-limit-->
  879. <!-- />-->
  880. <!-- </template>-->
  881. <!-- </el-table-column>-->
  882. <!-- <el-table-column-->
  883. <!-- prop="fCurrency"-->
  884. <!-- header-align="center"-->
  885. <!-- align="center"-->
  886. <!-- width="150px"-->
  887. <!-- label="币别"-->
  888. <!-- >-->
  889. <!-- <template slot-scope="scope">-->
  890. <!-- <el-input-->
  891. <!-- v-model="scope.row.fCurrency"-->
  892. <!-- :disabled="browseStatus"-->
  893. <!-- placeholder="币别"-->
  894. <!-- show-word-limit-->
  895. <!-- />-->
  896. <!-- </template>-->
  897. <!-- </el-table-column>-->
  898. <!-- <el-table-column-->
  899. <!-- prop="fExrate"-->
  900. <!-- header-align="center"-->
  901. <!-- align="center"-->
  902. <!-- width="150px"-->
  903. <!-- label="汇率"-->
  904. <!-- >-->
  905. <!-- <template slot-scope="scope">-->
  906. <!-- <el-input-->
  907. <!-- v-model="scope.row.fExrate"-->
  908. <!-- :disabled="browseStatus"-->
  909. <!-- placeholder="汇率"-->
  910. <!-- show-word-limit-->
  911. <!-- />-->
  912. <!-- </template>-->
  913. <!-- </el-table-column>-->
  914. <!-- <el-table-column-->
  915. <!-- prop="fTaxrate"-->
  916. <!-- header-align="center"-->
  917. <!-- align="center"-->
  918. <!-- width="150px"-->
  919. <!-- label="税率"-->
  920. <!-- >-->
  921. <!-- <template slot-scope="scope">-->
  922. <!-- <el-input-->
  923. <!-- v-model="scope.row.fTaxrate"-->
  924. <!-- :disabled="browseStatus"-->
  925. <!-- placeholder="税率"-->
  926. <!-- show-word-limit-->
  927. <!-- />-->
  928. <!-- </template>-->
  929. <!-- </el-table-column>-->
  930. <!-- <el-table-column-->
  931. <!-- prop="fMblno"-->
  932. <!-- header-align="center"-->
  933. <!-- align="center"-->
  934. <!-- width="130px"-->
  935. <!-- label="提单号"-->
  936. <!-- >-->
  937. <!-- <template slot-scope="scope">-->
  938. <!-- <el-input-->
  939. <!-- v-model="scope.row.fMblno"-->
  940. <!-- :disabled="browseStatus"-->
  941. <!-- placeholder="提单号"-->
  942. <!-- show-word-limit-->
  943. <!-- />-->
  944. <!-- </template>-->
  945. <!-- </el-table-column>-->
  946. <!-- <el-table-column-->
  947. <!-- prop="fProductName"-->
  948. <!-- header-align="center"-->
  949. <!-- align="center"-->
  950. <!-- width="140px"-->
  951. <!-- label="品名"-->
  952. <!-- >-->
  953. <!-- <template slot-scope="scope">-->
  954. <!-- <el-input-->
  955. <!-- v-model="scope.row.fProductName"-->
  956. <!-- :disabled="browseStatus"-->
  957. <!-- placeholder="品名"-->
  958. <!-- show-word-limit-->
  959. <!-- />-->
  960. <!-- </template>-->
  961. <!-- </el-table-column>-->
  962. <!-- <el-table-column-->
  963. <!-- prop="fMarks"-->
  964. <!-- header-align="center"-->
  965. <!-- align="center"-->
  966. <!-- width="130px"-->
  967. <!-- label="品牌"-->
  968. <!-- >-->
  969. <!-- <template slot-scope="scope">-->
  970. <!-- <el-input-->
  971. <!-- v-model="scope.row.fMarks"-->
  972. <!-- :disabled="browseStatus"-->
  973. <!-- placeholder="品牌"-->
  974. <!-- show-word-limit-->
  975. <!-- />-->
  976. <!-- </template>-->
  977. <!-- </el-table-column>-->
  978. <!-- <el-table-column-->
  979. <!-- prop="remark"-->
  980. <!-- header-align="center"-->
  981. <!-- align="center"-->
  982. <!-- width="150px"-->
  983. <!-- label="备注"-->
  984. <!-- >-->
  985. <!-- <template slot-scope="scope">-->
  986. <!-- <el-input-->
  987. <!-- v-model="scope.row.remark"-->
  988. <!-- :disabled="browseStatus"-->
  989. <!-- placeholder="备注"-->
  990. <!-- show-word-limit-->
  991. <!-- />-->
  992. <!-- </template>-->
  993. <!-- </el-table-column>-->
  994. <!-- <el-table-column-->
  995. <!-- header-align="center"-->
  996. <!-- align="center"-->
  997. <!-- width="200px"-->
  998. <!-- label="操作"-->
  999. <!-- >-->
  1000. <!-- <template slot-scope="scope">-->
  1001. <!-- <el-button-->
  1002. <!-- @click.native.prevent="deleteRow(scope.$index, warehouseDrList)"-->
  1003. <!-- size="small"-->
  1004. <!-- >移除-->
  1005. <!-- </el-button-->
  1006. <!-- >-->
  1007. <!-- </template>-->
  1008. <!-- </el-table-column>-->
  1009. <!-- </el-table>-->
  1010. <!-- </div>-->
  1011. <div slot="footer" class="dialog-footer">
  1012. <el-button type="success" v-if="form.fBillstatus === 6" @click="backrRconciliation">撤销请核</el-button>
  1013. <el-button v-if="approve === true" @click="goApproval('f_billstatus')">审批</el-button>
  1014. <el-button type="primary" v-if="form.fBillstatus > 3" @click="addOrUpdateHandle('f_billstatus')">查看审批流
  1015. </el-button>
  1016. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  1017. <el-button v-if="cancelButton === false" @click="homePage">取 消</el-button>
  1018. <el-button type="danger" :disabled="disappear" v-if="form.fBillstatus === '4' && Operator === Lander"
  1019. @click="backApproval('f_billstatus')">撤销审批
  1020. </el-button>
  1021. <el-button type="primary" :disabled="browseStatus" @click="submitForm(2)">保 存</el-button>
  1022. <el-button
  1023. :disabled="browseStatus"
  1024. style="background-color: #008000; color: #fff"
  1025. @click="submitForm(4)"
  1026. >请 核
  1027. </el-button>
  1028. </div>
  1029. </el-dialog>
  1030. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  1031. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  1032. </div>
  1033. </template>
  1034. <script>
  1035. import {
  1036. backFee,
  1037. calculateStorageFees,
  1038. getStorageFeeCalculation,
  1039. delStorageFeeCalculation,
  1040. addStorageFeeCalculation,
  1041. listStorageFeeCalculation,
  1042. updateStorageFeeCalculation,
  1043. exportStorageFeeCalculation,
  1044. exportWarehousebillsitems,
  1045. delstorageFeeCalculation_s,
  1046. exportWarehousebills
  1047. } from "@/api/warehouseBusiness/storageFeeCalculation";
  1048. import {listUser, queryUserVal} from "@/api/system/user";
  1049. import {listGoods} from "@/api/basicdata/goods";
  1050. import {listFees} from "@/api/basicdata/fees";
  1051. import {listCorps} from "@/api/basicdata/corps";
  1052. import moment from 'moment'
  1053. import AddOrUpdate from '@/views/viewApproval'
  1054. import ApprovalComments from '@/views/startApproval'
  1055. import Global from '@/layout/components/global'
  1056. import {getCharge} from '@/api/finance/charge'
  1057. import {RevocationApproval} from '@/api/finance/contrast'
  1058. import Vue from 'vue'
  1059. import UploadFile from '@/components/Uploadfile'
  1060. import draggable from "vuedraggable";
  1061. import Cookies from 'js-cookie'
  1062. import {addSet, select} from '@/api/system/set'
  1063. Vue.directive('dialogDrag', {
  1064. bind(el, binding, vnode, oldVnode) {
  1065. const dialogHeaderEl = el.querySelector('.el-dialog__header')
  1066. const dragDom = el.querySelector('.el-dialog')
  1067. const enlarge = el.querySelector('.enlarge')
  1068. dialogHeaderEl.style.cursor = 'move'
  1069. // 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
  1070. const sty = dragDom.currentStyle || window.getComputedStyle(dragDom, null)
  1071. if (enlarge) {
  1072. enlarge.onclick = (e) => {
  1073. dragDom.style.top = '0px'
  1074. dragDom.style.left = '0px'
  1075. }
  1076. }
  1077. dialogHeaderEl.onmousedown = (e) => {
  1078. // 鼠标按下,计算当前元素距离可视区的距离
  1079. const disX = e.clientX - dialogHeaderEl.offsetLeft
  1080. const disY = e.clientY - dialogHeaderEl.offsetTop
  1081. // 获取到的值带px 正则匹配替换
  1082. let styL, styT
  1083. // 注意在ie中 第一次获取到的值为组件自带50% 移动之后赋值为px
  1084. if (sty.left.includes('%')) {
  1085. styL = +document.body.clientWidth * (+sty.left.replace(/\%/g, '') / 100)
  1086. styT = +document.body.clientHeight * (+sty.top.replace(/\%/g, '') / 100)
  1087. } else {
  1088. styL = +sty.left.replace(/\px/g, '')
  1089. styT = +sty.top.replace(/\px/g, '')
  1090. }
  1091. document.onmousemove = function (e) {
  1092. // 通过事件委托,计算移动的距离
  1093. const l = e.clientX - disX
  1094. const t = e.clientY - disY
  1095. // 移动当前元素
  1096. if ((t + styT) >= 0) {
  1097. dragDom.style.top = `${t + styT}px`
  1098. }
  1099. dragDom.style.left = `${l + styL}px`
  1100. // 将此时的位置传出去
  1101. // binding.value({x:e.pageX,y:e.pageY})
  1102. }
  1103. document.onmouseup = function (e) {
  1104. document.onmousemove = null
  1105. document.onmouseup = null
  1106. }
  1107. }
  1108. }
  1109. })
  1110. export default {
  1111. name: "StorageFeeCalculation",
  1112. components: {
  1113. UploadFile,
  1114. AddOrUpdate,
  1115. ApprovalComments,
  1116. draggable,
  1117. },
  1118. data() {
  1119. return {
  1120. tableHeight: '600',
  1121. dialogFull: false,
  1122. drag: false,
  1123. countstate: false,
  1124. setRowList: [
  1125. {
  1126. surface: "1",
  1127. label: "createBy",
  1128. name: "制单人",
  1129. checked: 0,
  1130. width: null,
  1131. },
  1132. {
  1133. surface: "2",
  1134. label: "fBillno",
  1135. name: "单据编号",
  1136. checked: 0,
  1137. width: null,
  1138. },
  1139. {
  1140. surface: "3",
  1141. label: "fCorpid",
  1142. name: "客户名称",
  1143. checked: 0,
  1144. width: null,
  1145. },
  1146. {
  1147. surface: "4",
  1148. label: "fBillingDeadline",
  1149. name: "计费日期",
  1150. checked: 0,
  1151. width: null,
  1152. },
  1153. {
  1154. surface: "5",
  1155. label: "remark",
  1156. name: "备注",
  1157. checked: 0,
  1158. width: null,
  1159. },
  1160. {
  1161. surface: "6",
  1162. label: "fBillstatus",
  1163. name: "单据状态",
  1164. checked: 0,
  1165. width: null,
  1166. },
  1167. {
  1168. surface: "7",
  1169. label: "createTime",
  1170. name: "制单日期",
  1171. checked: 0,
  1172. width: null,
  1173. },
  1174. ],
  1175. getRowList: [
  1176. {
  1177. surface: "1",
  1178. label: "createBy",
  1179. name: "制单人",
  1180. checked: 0,
  1181. width: null,
  1182. },
  1183. {
  1184. surface: "2",
  1185. label: "fBillno",
  1186. name: "单据编号",
  1187. checked: 0,
  1188. width: null,
  1189. },
  1190. {
  1191. surface: "3",
  1192. label: "fCorpid",
  1193. name: "客户名称",
  1194. checked: 0,
  1195. width: null,
  1196. },
  1197. {
  1198. surface: "4",
  1199. label: "fBillingDeadline",
  1200. name: "计费日期",
  1201. checked: 0,
  1202. width: null,
  1203. },
  1204. {
  1205. surface: "5",
  1206. label: "remark",
  1207. name: "备注",
  1208. checked: 0,
  1209. width: null,
  1210. },
  1211. {
  1212. surface: "6",
  1213. label: "fBillstatus",
  1214. name: "单据状态",
  1215. checked: 0,
  1216. width: null,
  1217. },
  1218. {
  1219. surface: "7",
  1220. label: "createTime",
  1221. name: "制单日期",
  1222. checked: 0,
  1223. width: null,
  1224. },
  1225. ],
  1226. allCheck: false,
  1227. showSetting: false,
  1228. Lander: '',
  1229. Operator: '',
  1230. actId: 150,
  1231. disappear: false,
  1232. cancelButton: true,
  1233. Xbutton: true,
  1234. approve: false,
  1235. addOrUpdateVisib: false,
  1236. addOrUpdateVisible: false,
  1237. notChange: false,
  1238. // 遮罩层
  1239. loading: true,
  1240. // 选中数组
  1241. ids: [],
  1242. userVal: {
  1243. userName: null,
  1244. nickName: null,
  1245. deptId: null,
  1246. },
  1247. queryForm: {},
  1248. // 库存总账表
  1249. whgenlegList: [],
  1250. dataList: [],
  1251. warehouseDrList: [],
  1252. browseStatus: false,
  1253. // 非单个禁用
  1254. single: true,
  1255. // 非多个禁用
  1256. multiple: true,
  1257. // 显示搜索条件
  1258. showSearch: true,
  1259. // 总条数
  1260. total: 0,
  1261. // 仓库主(出入库)表格数据
  1262. warehousebillsList: [],
  1263. // 弹出层标题
  1264. title: "",
  1265. // 是否显示弹出层
  1266. open: false,
  1267. // 货品名
  1268. goodsOptions: [],
  1269. // 货权方(客户数据)
  1270. fMblnoOptions: [],
  1271. // 操作员
  1272. userOptions: [],
  1273. // 制单部门
  1274. deptOptions: [],
  1275. // 计费单位(数据字典),下拉选择毛重或净重字典
  1276. fFeetunitOptions: [/*{
  1277. dictLabel: '件数',
  1278. dictValue: 1
  1279. }, {
  1280. dictLabel: '毛重',
  1281. dictValue: 2
  1282. }, {
  1283. dictLabel: '净重',
  1284. dictValue: 3
  1285. }, {
  1286. dictLabel: '尺码',
  1287. dictValue: 4
  1288. }, {
  1289. dictLabel: '固定',
  1290. dictValue: 5
  1291. }*/],
  1292. fTaxrate: 0,
  1293. // 费用名称
  1294. fWbuOptions: [],
  1295. // 查询参数
  1296. queryParams: {
  1297. pageNum: 1,
  1298. pageSize: 10,
  1299. fBillno: null,
  1300. createBy: null,
  1301. createTime: null,
  1302. fCustomsdeclartion: null,
  1303. fOriginalbillno: null,
  1304. fDeptid: null,
  1305. fBsdeptid: null,
  1306. fContacts: null,
  1307. fTel: null,
  1308. fCorpid: null,
  1309. fTocorpid: null,
  1310. fStltypeid: null,
  1311. fBscorpno: null,
  1312. fWarehouseid: null,
  1313. fStorekeeper: null,
  1314. fBsdate: null,
  1315. fPlanqty: null,
  1316. fPlangrossweight: null,
  1317. fPlannetweight: null,
  1318. fPlanvolumn: null,
  1319. fQty: null,
  1320. fGrossweight: null,
  1321. fNetweight: null,
  1322. fVolumn: null,
  1323. fTrademodeid: null,
  1324. fSbu: null,
  1325. fFeetunit: null,
  1326. fMblno: null,
  1327. fVslvoy: null,
  1328. fEta: null,
  1329. fCustomno: null,
  1330. fIfweigh: null,
  1331. fIfpledge: null,
  1332. fIfdamage: null,
  1333. fBankcorpid: null,
  1334. fBilltype: null,
  1335. fBillstatus: null,
  1336. fCreateby: null,
  1337. fCreatetime: null,
  1338. fGoodsid: null,
  1339. fCntrtype: null,
  1340. fCntqty: null,
  1341. },
  1342. // 表单参数
  1343. form: {},
  1344. // 表单校验
  1345. rules: {
  1346. fCorpid: [{required: true, message: " ", trigger: "blur",}],
  1347. fBillingDeadline: [{required: true, message: " ", trigger: "blur",}],
  1348. fGoodsid: [{required: true, message: " ", trigger: "blur",}]
  1349. }
  1350. };
  1351. },
  1352. created() {
  1353. // let date = new Date();
  1354. // let year = parseInt(date.getFullYear())
  1355. // let month = parseInt(date.getMonth() + 1)
  1356. // let currentMonth = date.getMonth()
  1357. // let nextMonth = ++currentMonth
  1358. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  1359. // let oneDay = 1000*60*60*24
  1360. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  1361. // let day = lastTime.getDate()
  1362. // if (day < 10) {
  1363. // day = '0' + day
  1364. // }
  1365. // this.$set(this.queryParams,'timeInterval', [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59'])
  1366. this.getList();
  1367. this.getDicts("tax_rate").then((response) => {
  1368. this.fTaxrate = response.data[0].dictValue
  1369. });
  1370. this.getDicts('data_unitfees').then((response) => {
  1371. this.fFeetunitOptions = response.data
  1372. })
  1373. this.register()
  1374. },
  1375. activated() {
  1376. this.Jump()
  1377. },
  1378. mounted() {
  1379. this.$nextTick(() => {
  1380. // 监听浏览器高度变化,改变表格高度
  1381. window.onresize = () => {
  1382. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  1383. }
  1384. })
  1385. },
  1386. methods: {
  1387. full() {
  1388. this.dialogFull = !this.dialogFull
  1389. },
  1390. // 获取当前月的第一天和最后一天
  1391. getMonth() {
  1392. let date = new Date();
  1393. let year = parseInt(date.getFullYear())
  1394. let month = parseInt(date.getMonth() + 1)
  1395. let currentMonth = date.getMonth()
  1396. let nextMonth = ++currentMonth
  1397. let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  1398. let oneDay = 1000*60*60*24
  1399. let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  1400. let day = lastTime.getDate()
  1401. if (day < 10) {
  1402. day = '0' + day
  1403. }
  1404. this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
  1405. },
  1406. //列设置全选
  1407. allChecked() {
  1408. if (this.allCheck == true) {
  1409. this.setRowList.map((e) => {
  1410. return (e.checked = 0);
  1411. });
  1412. } else {
  1413. this.setRowList.map((e) => {
  1414. return (e.checked = 1);
  1415. });
  1416. }
  1417. },
  1418. //查询列数据
  1419. getRow() {
  1420. let that = this;
  1421. this.data = {
  1422. tableName: "货转",
  1423. userId: Cookies.get("userName"),
  1424. };
  1425. select(this.data).then((res) => {
  1426. if (res.data.length != 0) {
  1427. this.getRowList = res.data.filter((e) => e.checked == 0);
  1428. this.setRowList = res.data;
  1429. this.setRowList = this.setRowList.reduce((res, item) => {
  1430. res.push({
  1431. surface: item.surface,
  1432. label: item.label,
  1433. name: item.name,
  1434. checked: item.checked,
  1435. width: item.width,
  1436. });
  1437. return res;
  1438. }, []);
  1439. }
  1440. });
  1441. },
  1442. //保存列设置
  1443. save() {
  1444. this.showSetting = false;
  1445. this.data = {
  1446. tableName: "货转",
  1447. userId: Cookies.get("userName"),
  1448. sysTableSetList: this.setRowList,
  1449. };
  1450. addSet(this.data).then((res) => {
  1451. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1452. });
  1453. },
  1454. //开始拖拽事件
  1455. onStart() {
  1456. this.drag = true;
  1457. },
  1458. //拖拽结束事件
  1459. onEnd() {
  1460. this.drag = false;
  1461. },
  1462. // 撤销审核
  1463. backrRconciliation() {
  1464. // this.form.fBillstatus = '1'
  1465. backFee(this.form.fId).then(response => {
  1466. this.msgSuccess("撤回成功")
  1467. this.getList()
  1468. this.open = false
  1469. this.getList()
  1470. })
  1471. },
  1472. // 默认录入人
  1473. register() {
  1474. queryUserVal().then((response) => {
  1475. this.Lander = response.user.userName
  1476. })
  1477. },
  1478. // 撤销审批
  1479. backApproval() {
  1480. let data = {
  1481. id: this.form.fId,
  1482. actId: 150,
  1483. billId: this.form.fId
  1484. }
  1485. RevocationApproval(data).then(response => {
  1486. this.msgSuccess("撤销审批成功")
  1487. this.disappear = true
  1488. this.open = false
  1489. this.getList()
  1490. })
  1491. },
  1492. homepaGe() {
  1493. let view = {
  1494. fullPath: "/business/agreement",
  1495. hash: "",
  1496. matched: Array(2),
  1497. meta: Object,
  1498. name: "Agreement",
  1499. params: Object,
  1500. path: "/business/agreement",
  1501. query: Object,
  1502. title: "仓储费"
  1503. }
  1504. this.$router.push({path: '/index'})
  1505. this.$store.dispatch('tagsView/delView', view).then(({visitedViews}) => {
  1506. if (this.isActive(view)) {
  1507. this.toLastView(visitedViews, view)
  1508. }
  1509. })
  1510. Global.$emit("removeCache", "closeSelectedTag", view);
  1511. },
  1512. Jump() {
  1513. this.approval = this.$route.query.data
  1514. if (this.approval) {
  1515. this.reset()
  1516. this.browseStatus = status;
  1517. this.Xbutton = false
  1518. this.approval = JSON.parse(this.approval)
  1519. // this.hide = false
  1520. this.notChange = true
  1521. this.approve = true
  1522. this.cancelButton = false
  1523. getStorageFeeCalculation(this.approval.billId).then(response => {
  1524. this.fMblnoOptions = []
  1525. if (response.data.corps) {
  1526. this.fMblnoOptions.push(response.data.corps)
  1527. }
  1528. if (response.data.warehouse) {
  1529. this.form = response.data.warehouse
  1530. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1531. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1532. }
  1533. if (response.data.warehouseItemsList) {
  1534. this.dataList = response.data.warehouseItemsList
  1535. for (let li in this.dataList) {
  1536. this.$set(this.dataList[li], 'fBillingway', this.dataList[li].fBillingway + '')
  1537. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1538. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1539. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1540. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1541. }
  1542. }
  1543. if (response.data.warehouseFeesList) {
  1544. this.warehouseDrList = response.data.warehouseFeesList
  1545. for (let dr in this.warehouseDrList) {
  1546. this.$set(this.warehouseDrList[dr], "fFeeunitid", this.warehouseDrList[dr].fFeeunitid + '');
  1547. }
  1548. }
  1549. if (response.data.feesList) {
  1550. this.fWbuOptions = response.data.feesList
  1551. }
  1552. this.userOptions = response.data.sysUser;
  1553. this.open = true;
  1554. this.title = "编辑仓储费计算";
  1555. });
  1556. }
  1557. },
  1558. // 审批按钮
  1559. goApproval(status) {
  1560. this.addOrUpdateVisib = true
  1561. this.$nextTick(() => {
  1562. this.$refs.ApprovalComments.init(this.form.fId, status, this.actId)
  1563. })
  1564. },
  1565. homePage() {
  1566. this.open = false
  1567. let view = {
  1568. fullPath: "/business/agreement",
  1569. hash: "",
  1570. matched: Array(2),
  1571. meta: Object,
  1572. name: "Agreement",
  1573. params: Object,
  1574. path: "/business/agreement",
  1575. query: Object,
  1576. title: "仓储费"
  1577. }
  1578. this.$router.push({path: '/index'})
  1579. this.$store.dispatch('tagsView/delView', view).then(({visitedViews}) => {
  1580. if (this.isActive(view)) {
  1581. this.toLastView(visitedViews, view)
  1582. }
  1583. })
  1584. Global.$emit("removeCache", "closeSelectedTag", view);
  1585. },
  1586. // 查看审批流
  1587. addOrUpdateHandle(status) {
  1588. this.addOrUpdateVisible = true
  1589. this.addOrUpdateVisib = false
  1590. let id = '448'
  1591. let actId = '110'
  1592. this.$nextTick(() => {
  1593. this.$refs.addOrUpdate.init(this.form.fId, this.actId, status)
  1594. })
  1595. },
  1596. returnData() {
  1597. this.addOrUpdateVisib = false
  1598. this.open = false
  1599. this.homepaGe()
  1600. },
  1601. getDataList() {
  1602. this.addOrUpdateVisible = false
  1603. },
  1604. queryUser() {
  1605. queryUserVal().then((response) => {
  1606. if (response.user !== null) {
  1607. this.userVal = response.user;
  1608. this.$set(this.form, "fDeptid", this.userVal.deptId);
  1609. this.$set(this.form, "createBy", this.userVal.userName);
  1610. this.$set(this.form, "fIfdamage", "1");
  1611. this.$set(this.form, "fIfweigh", "1");
  1612. this.$set(this.form, "fTrademodeid", "1");
  1613. this.$set(this.form, "createTime", Date.parse(new Date()));
  1614. }
  1615. if (response.dept !== null) {
  1616. this.deptOptions = [];
  1617. this.deptOptions.push(response.dept);
  1618. }
  1619. });
  1620. },
  1621. /** 查询仓库主(出入库)列表 */
  1622. getList() {
  1623. this.loading = true;
  1624. listStorageFeeCalculation(this.queryParams).then((response) => {
  1625. this.warehousebillsList = response.rows;
  1626. this.$set(this.form, 'createTime', moment(Date.parse(this.warehousebillsList.createTime)).format("YYYY-MM-DD HH:mm:ss"))
  1627. this.total = response.total;
  1628. this.loading = false;
  1629. // 根据浏览器高度设置初始高度
  1630. setInterval(() => {
  1631. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  1632. }, 300)
  1633. });
  1634. },
  1635. // 取消按钮
  1636. cancel() {
  1637. this.open = false;
  1638. this.reset();
  1639. this.getList();
  1640. },
  1641. // 计算仓储费
  1642. calculateCost() {
  1643. this.countstate = true
  1644. if (!this.form.fCorpid || !this.form.fBillingDeadline) {
  1645. this.$message({message: '请维护货权方以及,仓储费计算截止日期', type: 'warning'})
  1646. this.countstate = false
  1647. return false
  1648. }
  1649. if (this.dataList.length !== 0) {
  1650. this.$confirm(`仓储费已经存在,确定要删除重新计算吗?`, '提示', {
  1651. confirmButtonText: '确定',
  1652. cancelButtonText: '取消',
  1653. type: 'warning'
  1654. }).then(() => {
  1655. this.dataList = []
  1656. this.getStorageFee()
  1657. }).catch(() => {
  1658. return false
  1659. })
  1660. } else {
  1661. this.dataList = []
  1662. this.getStorageFee()
  1663. }
  1664. },
  1665. // 添加费用新行
  1666. // 收款信息
  1667. addCollection() {
  1668. this.warehouseDrList.push({
  1669. fCorpid: null,
  1670. fFeeid: null,
  1671. fFeeunitid: "2",
  1672. fQty: 0,
  1673. fUnitprice: 0,
  1674. fAmount: 0,
  1675. fCurrency: "RMB",
  1676. fExrate: "1",
  1677. fTaxrate: this.fTaxrate,
  1678. fCxrate: "1",
  1679. fRate: null,
  1680. remark: null,
  1681. });
  1682. },
  1683. getStorageFee() {
  1684. calculateStorageFees(this.form).then((response) => {
  1685. this.dataList = []
  1686. this.warehouseDrList = []
  1687. this.form.fId = response.data.warehouseBills.fId
  1688. this.form.fBillno = response.data.warehouseBills.fBillno
  1689. if (response.data.warehouseFeesList) {
  1690. this.warehouseDrList = response.data.warehouseFeesList
  1691. }
  1692. if (response.data.warehouseItemList) {
  1693. this.dataList = response.data.warehouseItemList
  1694. for (let li in this.dataList) {
  1695. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1696. this.$set(this.dataList[li], 'fBillingway', this.dataList[li].fBillingway + '')
  1697. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1698. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1699. this.$set(this.dataList[li], 'fOriginalbilldate', Date.parse(this.dataList[li].fOriginalbilldate))
  1700. this.$set(this.dataList[li], 'fBillingway', this.dataList[li].fBillingway + '')
  1701. }
  1702. }
  1703. if (response.data.feesList) {
  1704. this.fWbuOptions = response.data.feesList
  1705. }
  1706. this.countstate = false
  1707. });
  1708. },
  1709. /* 远程模糊查询商品 */
  1710. goodsRemoteMethod(name) {
  1711. if (name == null || name === "") {
  1712. return false;
  1713. }
  1714. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  1715. listGoods(queryParams).then((response) => {
  1716. this.goodsOptions = response.rows;
  1717. });
  1718. },
  1719. // 表单重置
  1720. reset() {
  1721. this.form = {
  1722. fId: null,
  1723. fBillno: null,
  1724. fCustomsdeclartion: null,
  1725. fOriginalbillno: null,
  1726. fDeptid: null,
  1727. fBsdeptid: null,
  1728. fContacts: null,
  1729. fTel: null,
  1730. fCorpid: null,
  1731. fTocorpid: null,
  1732. fStltypeid: null,
  1733. fBscorpno: null,
  1734. fWarehouseid: null,
  1735. fStorekeeper: null,
  1736. fBsdate: null,
  1737. fPlanqty: null,
  1738. fPlangrossweight: null,
  1739. fPlannetweight: null,
  1740. fPlanvolumn: null,
  1741. fQty: null,
  1742. fGrossweight: null,
  1743. fNetweight: null,
  1744. fVolumn: null,
  1745. fTrademodeid: null,
  1746. fSbu: null,
  1747. fFeetunit: null,
  1748. fMblno: null,
  1749. fVslvoy: null,
  1750. fEta: null,
  1751. fCustomno: null,
  1752. fIfweigh: null,
  1753. fIfpledge: null,
  1754. fIfdamage: null,
  1755. fBankcorpid: null,
  1756. fBilltype: null,
  1757. fBillstatus: null,
  1758. delFlag: null,
  1759. createBy: null,
  1760. createTime: null,
  1761. updateBy: null,
  1762. updateTime: null,
  1763. remark: null,
  1764. fCreateby: null,
  1765. fCreatetime: null,
  1766. fGoodsid: null,
  1767. fCntrtype: null,
  1768. fCntqty: null,
  1769. };
  1770. this.deptOptions = [];
  1771. this.userOptions = [];
  1772. this.fWbuOptions = [];
  1773. this.fMblnoOptions = [];
  1774. this.disappear = false
  1775. this.addOrUpdateVisib = false
  1776. this.addOrUpdateVisible = false
  1777. this.notChange = false
  1778. this.loading = false
  1779. this.browseStatus = false
  1780. this.resetForm("form");
  1781. },
  1782. /** 搜索按钮操作 */
  1783. handleQuery() {
  1784. this.queryParams.pageNum = 1;
  1785. this.getList();
  1786. },
  1787. /** 重置按钮操作 */
  1788. resetQuery() {
  1789. this.queryParams = {
  1790. fBillstatus: null,
  1791. fBillno: null,
  1792. createBy: null,
  1793. timeInterval: null,
  1794. fCorpid: null,
  1795. fMblno: null,
  1796. fSbu: null,
  1797. fGoodsid: null,
  1798. fWarehouseid: null,
  1799. fMarks: null,
  1800. }
  1801. this.resetForm("queryForm");
  1802. this.handleQuery();
  1803. },
  1804. // 多选框选中数据
  1805. handleSelectionChange(selection) {
  1806. this.ids = selection;
  1807. // this.ids = selection.map((item) => item.fId);
  1808. this.single = selection.length !== 1 || selection.map((item) => item.fBillstatus) == 6 || selection.map((item) => item.fBillstatus) == 4;
  1809. this.multiple = !selection.length;
  1810. },
  1811. /** 新增按钮操作 */
  1812. handleAdd(status) {
  1813. this.reset();
  1814. this.browseStatus = status;
  1815. this.queryUser();
  1816. this.open = true;
  1817. this.dataList = [];
  1818. this.warehouseCrList = [];
  1819. this.warehouseDrList = [];
  1820. this.relevantAttachments = [];
  1821. this.title = "出库单";
  1822. },
  1823. handleUpdate_s(row, status) {
  1824. const queryParams = {pageNum: 1, pageSize: 10, fName: ''};
  1825. listGoods(queryParams).then((response) => {
  1826. this.goodsOptions = response.rows;
  1827. });
  1828. this.reset();
  1829. this.notChange = true
  1830. this.browseStatus = status;
  1831. let data = row || this.ids;
  1832. getStorageFeeCalculation(data.fId).then((response) => {
  1833. this.fMblnoOptions = []
  1834. if (response.data.corps) {
  1835. this.fMblnoOptions.push(response.data.corps)
  1836. }
  1837. if (response.data.warehouse) {
  1838. this.form = response.data.warehouse
  1839. this.Operator = this.form.createBy
  1840. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1841. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1842. }
  1843. if (response.data.warehouseItemsList) {
  1844. this.dataList = response.data.warehouseItemsList
  1845. for (let li in this.dataList) {
  1846. this.$set(this.dataList[li], 'fBillingway', this.dataList[li].fBillingway + '')
  1847. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1848. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1849. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1850. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1851. }
  1852. }
  1853. if (response.data.warehouseFeesList) {
  1854. this.warehouseDrList = response.data.warehouseFeesList
  1855. for (let dr in this.warehouseDrList) {
  1856. this.$set(this.warehouseDrList[dr], "fFeeunitid", this.warehouseDrList[dr].fFeeunitid + '');
  1857. }
  1858. }
  1859. if (response.data.feesList) {
  1860. this.fWbuOptions = response.data.feesList
  1861. }
  1862. this.userOptions = response.data.sysUser;
  1863. this.open = true;
  1864. this.title = "编辑仓储费计算";
  1865. });
  1866. },
  1867. /** 修改按钮操作 */
  1868. handleUpdate(row, status) {
  1869. const queryParams = {pageNum: 1, pageSize: 10, fName: ''};
  1870. listGoods(queryParams).then((response) => {
  1871. this.goodsOptions = response.rows;
  1872. });
  1873. this.reset();
  1874. this.disappear = false
  1875. this.notChange = true
  1876. this.browseStatus = status;
  1877. let fId = row.fId || this.ids;
  1878. if (fId.length === 1) {
  1879. fId = fId[0].fId
  1880. }
  1881. getStorageFeeCalculation(fId).then((response) => {
  1882. this.fMblnoOptions = []
  1883. if (response.data.corps) {
  1884. this.fMblnoOptions.push(response.data.corps)
  1885. }
  1886. if (response.data.warehouse) {
  1887. this.form = response.data.warehouse
  1888. this.Operator = this.form.createBy
  1889. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  1890. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  1891. }
  1892. if (response.data.warehouseItemsList) {
  1893. this.dataList = response.data.warehouseItemsList
  1894. for (let li in this.dataList) {
  1895. this.$set(this.dataList[li], 'fBillingway', this.dataList[li].fBillingway + '')
  1896. this.$set(this.dataList[li], 'fBsdate', Date.parse(this.dataList[li].fBsdate))
  1897. this.$set(this.dataList[li], 'fChargedate', Date.parse(this.dataList[li].fChargedate))
  1898. this.$set(this.dataList[li], 'fBillingDeadline', Date.parse(this.dataList[li].fBillingDeadline))
  1899. this.$set(this.dataList[li], 'fStorageFeeDeadline', Date.parse(this.dataList[li].fStorageFeeDeadline))
  1900. }
  1901. }
  1902. if (response.data.warehouseFeesList) {
  1903. this.warehouseDrList = response.data.warehouseFeesList
  1904. for (let dr in this.warehouseDrList) {
  1905. this.$set(this.warehouseDrList[dr], "fFeeunitid", this.warehouseDrList[dr].fFeeunitid + '');
  1906. }
  1907. }
  1908. if (response.data.feesList) {
  1909. this.fWbuOptions = response.data.feesList
  1910. }
  1911. this.userOptions = response.data.sysUser;
  1912. this.open = true;
  1913. this.title = "编辑仓储费计算";
  1914. });
  1915. },
  1916. changeEstmateAmt(row) {
  1917. let fQty = 0
  1918. let fUnitprice = 0
  1919. if (row.fUnitprice && row.fUnitprice !== "") {
  1920. fUnitprice = row.fUnitprice
  1921. }
  1922. if (row.fQty && row.fQty !== "") {
  1923. fQty = row.fQty
  1924. }
  1925. this.$set(row, "fAmount", Number(fUnitprice) * Number(fQty)).toFixed(2);
  1926. },
  1927. changefBsdate(row) {
  1928. if (this.dataList.length > 0) {
  1929. for (var i = 0; i < this.dataList.length; i++) {
  1930. this.$set(this.dataList[i], "fBsdate", row);
  1931. }
  1932. }
  1933. },
  1934. // 合计
  1935. getSummaries(param) {
  1936. const {columns, data} = param;
  1937. const sums = [];
  1938. var values = [];
  1939. columns.forEach((column, index) => {
  1940. if (index === 0) {
  1941. sums[index] = "合计";
  1942. return;
  1943. }
  1944. if (column.property === "fBillingQty") {
  1945. values = data.map((item) => Number(item["fBillingQty"]));
  1946. }
  1947. if (column.property === "fAmt") {
  1948. values = data.map((item) => Number(item["fAmt"]));
  1949. }
  1950. // const values = data.map(item => Number(item[column.property]))
  1951. if (column.property === "fBillingQty" || column.property === "fAmt") {
  1952. sums[index] = values.reduce((prev, curr) => {
  1953. const value = Number(curr);
  1954. if (!isNaN(value)) {
  1955. return prev + curr;
  1956. } else {
  1957. return prev;
  1958. }
  1959. }, 0);
  1960. sums[index] = sums[index].toFixed(2)
  1961. } else {
  1962. sums[index] = '-'
  1963. }
  1964. });
  1965. return sums;
  1966. },
  1967. // 付款合计
  1968. warehouseDrSummaries(param) {
  1969. const {columns, data} = param;
  1970. const sums = [];
  1971. columns.forEach((column, index) => {
  1972. if (index === 0) {
  1973. sums[index] = "合计";
  1974. return;
  1975. }
  1976. const values = data.map((item) => Number(item[column.property]));
  1977. if (column.property === "fAmount") {
  1978. sums[index] = values.reduce((prev, curr) => {
  1979. const value = Number(curr);
  1980. if (!isNaN(value)) {
  1981. return prev + curr;
  1982. } else {
  1983. return prev;
  1984. }
  1985. }, 0); // sums[index]
  1986. sums[index] = sums[index].toFixed(2)
  1987. } else {
  1988. sums[index] = '-'
  1989. }
  1990. });
  1991. return sums;
  1992. },
  1993. /** 删除按钮操作 */
  1994. handleDelete(row) {
  1995. const fIds = row.fId || this.ids.fId;
  1996. let tips = ''
  1997. delstorageFeeCalculation_s(fIds).then(data => {
  1998. switch (data.msg) {
  1999. case '0': {
  2000. this.$message.error('当前数据已被其他操作员操作请刷新页面')
  2001. break
  2002. }
  2003. case '1': {
  2004. tips = '当前主表有数据从表无数据是否删除'
  2005. this.delete_S(fIds, tips)
  2006. break
  2007. }
  2008. case '2': {
  2009. tips = '当前主表有数据从表有数据是否删除'
  2010. this.delete_S(fIds, tips)
  2011. break
  2012. }
  2013. default: {
  2014. return this.$message.error('未知错误,无状态')
  2015. }
  2016. }
  2017. })
  2018. },
  2019. delete_s(fIds, tips) {
  2020. this.$confirm(
  2021. tips,
  2022. "警告",
  2023. {
  2024. confirmButtonText: "确定",
  2025. cancelButtonText: "取消",
  2026. type: "warning",
  2027. }
  2028. )
  2029. .then(function () {
  2030. return delStorageFeeCalculation(fIds);
  2031. })
  2032. .then(() => {
  2033. this.getList();
  2034. this.msgSuccess("删除成功");
  2035. });
  2036. },
  2037. /** 导出按钮操作 */
  2038. handleExport() {
  2039. const queryParams = this.queryParams;
  2040. this.$confirm("是否确认导出所有仓库主(出入库)数据项?", "警告", {
  2041. confirmButtonText: "确定",
  2042. cancelButtonText: "取消",
  2043. type: "warning",
  2044. })
  2045. .then(function () {
  2046. return exportWarehousebills(queryParams);
  2047. })
  2048. .then((response) => {
  2049. this.download(response.msg);
  2050. });
  2051. },
  2052. handleExportItems() {
  2053. const fIds = this.form.fId
  2054. if (fIds !== null) {
  2055. this.$confirm("是否确认导出所有计费物资明细数据?", "警告", {
  2056. confirmButtonText: "确定",
  2057. cancelButtonText: "取消",
  2058. type: "warning",
  2059. })
  2060. .then(function () {
  2061. return exportWarehousebillsitems(fIds);
  2062. })
  2063. .then((response) => {
  2064. this.download(response.msg);
  2065. });
  2066. } else {
  2067. this.$message("请先保存")
  2068. }
  2069. },
  2070. deleteRow(index, rows) {
  2071. rows.splice(index, 1);
  2072. },
  2073. /* 远程模糊查询用户 */
  2074. corpsRemoteMethod(name) {
  2075. if (name == null || name === "") {
  2076. return false;
  2077. }
  2078. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  2079. listCorps(queryParams).then((response) => {
  2080. this.fMblnoOptions = response.rows;
  2081. });
  2082. },
  2083. // 远程模糊查询费用名称
  2084. fWRemoteMethod(name) {
  2085. if (name == null || name === "") {
  2086. return false;
  2087. }
  2088. let queryParams = {pageNum: 1, pageSize: 10, fName: name};
  2089. listFees(queryParams).then((response) => {
  2090. this.fWbuOptions = response.rows;
  2091. });
  2092. },
  2093. /* 远程模糊查询操作用户 */
  2094. userRemoteMethod(name) {
  2095. if (name == null || name === "") {
  2096. return false;
  2097. }
  2098. let queryParams = {pageNum: 1, pageSize: 10, userName: name};
  2099. listUser(queryParams).then((response) => {
  2100. this.userOptions = response.rows;
  2101. });
  2102. },
  2103. /** 提交按钮 */
  2104. submitForm(status) {
  2105. this.$refs["form"].validate((valid) => {
  2106. if (valid) {
  2107. if (status !== 2) {
  2108. if (this.dataList.length === 0) {
  2109. this.$message.error("请维护计费物资明细!");
  2110. return false;
  2111. }
  2112. }
  2113. if (!this.form.fCorpid) {
  2114. this.$message({message: '请维护货权方', type: 'warning'})
  2115. return false
  2116. }
  2117. if (!this.form.fBillingDeadline) {
  2118. this.$message({message: '请维护仓储费计算截止日期', type: 'warning'})
  2119. return false
  2120. }
  2121. if (this.form.fBillstatus !== 4) {
  2122. this.form.fBillstatus = status
  2123. }
  2124. let formData = new window.FormData();
  2125. formData.append("warehouseBills", JSON.stringify(this.form));
  2126. formData.append("warehouseItems", JSON.stringify(this.dataList));
  2127. formData.append("warehouseFees", JSON.stringify(this.warehouseDrList));
  2128. addStorageFeeCalculation(formData).then((response) => {
  2129. this.msgSuccess("操作成功");
  2130. if (status !== 2) {
  2131. this.open = false;
  2132. this.reset()
  2133. this.getList();
  2134. } else {
  2135. this.form = response.data
  2136. this.$set(this.form, 'createTime', Date.parse(this.form.createTime))
  2137. this.$set(this.form, 'fBillingDeadline', Date.parse(this.form.fBillingDeadline))
  2138. }
  2139. })
  2140. }
  2141. });
  2142. }
  2143. }
  2144. };
  2145. </script>
  2146. <style lang="scss" scoped>
  2147. @import 'src/assets/styles/element-variables.scss';
  2148. .tabSetting {
  2149. display: flex;
  2150. justify-content: flex-end;
  2151. }
  2152. .listStyle {
  2153. display: flex;
  2154. border-top: 1px solid #dcdfe6;
  2155. border-left: 1px solid #dcdfe6;
  2156. border-right: 1px solid #dcdfe6;
  2157. }
  2158. .listStyle:last-child {
  2159. border-bottom: 1px solid #dcdfe6;
  2160. }
  2161. .progress {
  2162. display: flex;
  2163. align-items: center;
  2164. padding: 2px;
  2165. background-color: rgba(0, 0, 0, 0.05);
  2166. height: 100%;
  2167. }
  2168. .juzhong > th {
  2169. text-align: center;
  2170. }
  2171. .biaoge > tr > td {
  2172. height: 30px;
  2173. text-align: center;
  2174. border-right: 1px solid #dfe6ec !important;
  2175. border-bottom: 1px solid #dfe6ec !important;
  2176. border-bottom: 1px solid #dfe6ec !important;
  2177. }
  2178. .el-table thead th {
  2179. background: #1890ff;
  2180. color: #fff;
  2181. }
  2182. .upload-demo {
  2183. margin-left: 50px;
  2184. }
  2185. .el-form-item {
  2186. margin-bottom: 5px !important;
  2187. }
  2188. .el-form-item__label {
  2189. font-size: 12px !important;
  2190. }
  2191. .avue-crud__dialog__header {
  2192. display: -webkit-box;
  2193. display: -ms-flexbox;
  2194. display: flex;
  2195. -webkit-box-align: center;
  2196. -ms-flex-align: center;
  2197. align-items: center;
  2198. -webkit-box-pack: justify;
  2199. -ms-flex-pack: justify;
  2200. justify-content: space-between;
  2201. }
  2202. .el-dialog__title {
  2203. color: rgba(0, 0, 0, .85);
  2204. font-weight: 500;
  2205. word-wrap: break-word;
  2206. }
  2207. .avue-crud__dialog__menu {
  2208. padding-right: 20px;
  2209. float: left;
  2210. }
  2211. .avue-crud__dialog__menu i {
  2212. color: #909399;
  2213. font-size: 15px;
  2214. }
  2215. .el-icon-full-screen {
  2216. cursor: pointer;
  2217. }
  2218. .el-icon-full-screen:before {
  2219. content: "\e719";
  2220. }
  2221. </style>