index.vue 79 KB

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