index.vue 99 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="88px"
  9. >
  10. <el-form-item label="业务编号" prop="fBillno">
  11. <el-input
  12. v-model="queryParams.fBillno"
  13. placeholder="请输入业务编号"
  14. style="width: 80%"
  15. clearable
  16. size="small"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="制单人" prop="createBy">
  21. <el-select
  22. v-model="queryParams.createBy"
  23. filterable
  24. remote
  25. clearable
  26. style="width: 80%"
  27. :remote-method="userRemoteMethod"
  28. placeholder="请选择制单人"
  29. >
  30. <el-option
  31. v-for="(dict, index) in userOptions"
  32. :key="index.userName"
  33. :label="dict.nickName"
  34. :value="dict.userName"
  35. ></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="货转日期" prop="fBsdate">
  39. <el-date-picker
  40. v-model="queryParams.timeInterval"
  41. type="daterange"
  42. value-format="yyyy-MM-dd"
  43. clearable
  44. style="width: 60%"
  45. range-separator="至"
  46. start-placeholder="开始日期"
  47. end-placeholder="结束日期"
  48. @keyup.enter.native="handleQuery"
  49. >
  50. </el-date-picker>
  51. </el-form-item>
  52. <el-form-item label="贸易方式" prop="fTrademodeid">
  53. <el-select
  54. v-model="queryParams.fTrademodeid"
  55. placeholder="请选择贸易方式"
  56. clearable
  57. style="width: 80%"
  58. @keyup.enter.native="handleQuery"
  59. >
  60. <el-option
  61. v-for="(dict, index) in fTrademodeidOptions"
  62. :key="index.dictValue"
  63. :label="dict.dictLabel"
  64. :value="dict.dictValue"
  65. />
  66. </el-select>
  67. </el-form-item>
  68. <el-form-item label="货权方" prop="fCorpid">
  69. <el-select
  70. v-model="queryParams.fCorpid"
  71. filterable
  72. remote
  73. clearable
  74. style="width: 80%"
  75. @keyup.enter.native="handleQuery"
  76. :remote-method="corpsRemoteMethod"
  77. placeholder="请选择货权方"
  78. >
  79. <el-option
  80. v-for="(dict, index) in fMblnoOptions"
  81. :key="index.fId"
  82. :label="dict.fName"
  83. :value="dict.fId"
  84. ></el-option>
  85. </el-select>
  86. </el-form-item>
  87. <el-form-item label="提单号" prop="fMblno">
  88. <el-input
  89. v-model="queryParams.fMblno"
  90. placeholder="请输入提单号"
  91. style="width: 80%"
  92. clearable
  93. size="small"
  94. @keyup.enter.native="handleQuery"
  95. />
  96. </el-form-item>
  97. <el-form-item label="经营单位" prop="fSbu">
  98. <el-select
  99. v-model="queryParams.fSbu"
  100. filterable
  101. remote
  102. clearable
  103. :remote-method="fSbuRemoteMethod"
  104. @keyup.enter.native="handleQuery"
  105. style="width: 80%"
  106. placeholder="请选择经营单位"
  107. >
  108. <el-option
  109. v-for="(dict, index) in fSbuOptions"
  110. :key="index.fId"
  111. :label="dict.fName"
  112. :value="dict.fId"
  113. ></el-option>
  114. </el-select>
  115. </el-form-item>
  116. <el-form-item label="货物名称" prop="fGoodsid">
  117. <el-select
  118. v-model="queryParams.fGoodsid"
  119. filterable
  120. remote
  121. clearable
  122. :remote-method="goodsRemoteMethod"
  123. @keyup.enter.native="handleQuery"
  124. placeholder="请选择货物名称"
  125. >
  126. <el-option
  127. v-for="(dict, index) in goodsOptions"
  128. :key="index.fId"
  129. :label="dict.fName"
  130. :value="dict.fId"
  131. ></el-option>
  132. </el-select>
  133. </el-form-item>
  134. <el-form-item label="仓库" prop="fWarehouseid">
  135. <el-select
  136. v-model="queryParams.fWarehouseid"
  137. filterable
  138. :disabled="browseStatus"
  139. remote
  140. clearable
  141. style="width: 80%"
  142. :remote-method="warehouseRemoteMethod"
  143. @keyup.enter.native="handleQuery"
  144. placeholder="请选择仓库"
  145. >
  146. <el-option
  147. v-for="(dict, index) in warehouseOptions"
  148. :key="index.fId"
  149. :label="dict.fName"
  150. :value="dict.fId"
  151. ></el-option>
  152. </el-select>
  153. </el-form-item>
  154. <el-form-item label="品牌" prop="fMarks">
  155. <el-input
  156. v-model="queryParams.fMarks"
  157. placeholder="请输入品牌"
  158. clearable
  159. style="width: 80%"
  160. size="small"
  161. @keyup.enter.native="handleQuery"
  162. />
  163. </el-form-item>
  164. <el-form-item>
  165. <el-button
  166. type="cyan"
  167. icon="el-icon-search"
  168. size="mini"
  169. @click="handleQuery"
  170. >搜索
  171. </el-button>
  172. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  173. >重置
  174. </el-button>
  175. </el-form-item>
  176. </el-form>
  177. <el-row :gutter="10" class="mb8">
  178. <el-col :span="1.5">
  179. <el-button
  180. type="primary"
  181. icon="el-icon-plus"
  182. size="mini"
  183. @click="handleAdd"
  184. v-hasPermi="['warehouseBusiness:goodsTransfer:add']"
  185. >新增
  186. </el-button>
  187. </el-col>
  188. <el-col :span="1.5">
  189. <el-button
  190. type="success"
  191. icon="el-icon-edit"
  192. size="mini"
  193. :disabled="single"
  194. @click="handleUpdate"
  195. v-hasPermi="['warehouseBusiness:goodsTransfer:edit']"
  196. >修改
  197. </el-button>
  198. </el-col>
  199. <el-col :span="1.5">
  200. <el-button
  201. type="warning"
  202. icon="el-icon-download"
  203. size="mini"
  204. @click="handleExport"
  205. v-hasPermi="['warehouseBusiness:goodsTransfer:export']"
  206. >导出
  207. </el-button>
  208. </el-col>
  209. <right-toolbar
  210. :showSearch.sync="showSearch"
  211. @queryTable="getList"
  212. ></right-toolbar>
  213. </el-row>
  214. <el-table
  215. v-loading="loading"
  216. :data="goodsTransferList"
  217. @selection-change="handleSelectionChange"
  218. >
  219. <el-table-column type="selection" width="55" align="center"/>
  220. <el-table-column type="index" label="行号" align="center"/>
  221. <el-table-column
  222. :show-overflow-tooltip="true"
  223. label="货权方"
  224. align="center"
  225. prop="fCorpid"
  226. />
  227. <el-table-column
  228. :show-overflow-tooltip="true"
  229. label="转货权方"
  230. align="center"
  231. prop="fTocorpid"
  232. />
  233. <el-table-column label="品名" :show-overflow-tooltip="true" align="ceter" prop="fProductName" />
  234. <el-table-column
  235. :show-overflow-tooltip="true"
  236. label="品牌"
  237. align="center"
  238. prop="fMarks"
  239. />
  240. <el-table-column
  241. :show-overflow-tooltip="true"
  242. label="业务编号"
  243. align="center"
  244. prop="fBillno"
  245. />
  246. <el-table-column
  247. label="货转日期"
  248. align="center"
  249. prop="fBsdate"
  250. width="180"
  251. >
  252. <template slot-scope="scope">
  253. <span>{{ parseTime(scope.row.fBsdate, '{y}-{m}-{d}') }}</span>
  254. </template>
  255. </el-table-column>
  256. <el-table-column
  257. label="贸易方式"
  258. align="center"
  259. prop="fTrademodeid"
  260. :formatter="fTrademodeidFormat"
  261. />
  262. <el-table-column label="仓库" align="center" prop="fWarehouseid"/>
  263. <el-table-column label="件数" align="center" prop="fQty"/>
  264. <el-table-column label="毛重" align="center" prop="fGrossweight"/>
  265. <el-table-column label="净重" align="center" prop="fNetweight"/>
  266. <el-table-column
  267. width="100"
  268. label="货转状态"
  269. align="center"
  270. prop="fItemsStatus"
  271. >
  272. <template slot-scope="scope">
  273. <span v-if="scope.row.fItemsStatus === 1">计划</span>
  274. <span v-if="scope.row.fItemsStatus === 2">待货转</span>
  275. <span v-if="scope.row.fItemsStatus === 6">已货转</span>
  276. </template>
  277. </el-table-column>
  278. <el-table-column label="费用状态" align="center" prop="fBillstatus" width="120">
  279. <template slot-scope="scope">
  280. <span v-if="scope.row.fBillstatus == '1'">保存</span>
  281. <span v-else-if="scope.row.fBillstatus == '2'">暂存</span>
  282. <span v-else-if="scope.row.fBillstatus == '3'">审批驳回</span>
  283. <span v-else-if="scope.row.fBillstatus == '4'">提交审核</span>
  284. <span v-else-if="scope.row.fBillstatus == '5'">审核中</span>
  285. <span v-else-if="scope.row.fBillstatus == '6'">审核完成</span>
  286. </template>
  287. </el-table-column>
  288. <el-table-column
  289. label="操作"
  290. align="center"
  291. class-name="small-padding fixed-width"
  292. width="100"
  293. >
  294. <template slot-scope="scope">
  295. <el-button
  296. size="mini"
  297. type="text"
  298. icon="el-icon-edit"
  299. @click="check_s(scope.row,0)"
  300. v-hasPermi="['warehouseBusiness:goodsTransfer:edit']"
  301. >查看
  302. </el-button>
  303. <el-button
  304. size="mini"
  305. type="text"
  306. icon="el-icon-edit"
  307. v-if="scope.row.fBillstatus <= 3"
  308. @click="handleUpdate(scope.row, false)"
  309. v-hasPermi="['warehouseBusiness:goodsTransfer:edit']"
  310. >修改
  311. </el-button>
  312. <el-button
  313. size="mini"
  314. type="text"
  315. icon="el-icon-edit"
  316. v-if="scope.row.fBillstatus === 4 || scope.row.fBillstatus === 5"
  317. @click="check(scope.row)"
  318. v-hasPermi="['warehouseBusiness:goodsTransfer:edit']"
  319. >审批进度
  320. </el-button>
  321. <el-button
  322. size="mini"
  323. type="text"
  324. icon="el-icon-delete"
  325. v-if="scope.row.fItemsStatus === 1"
  326. @click="handleDelete(scope.row)"
  327. v-hasPermi="['warehouseBusiness:goodsTransfer:remove']"
  328. >删除
  329. </el-button>
  330. </template>
  331. </el-table-column>
  332. </el-table>
  333. <pagination
  334. v-show="total > 0"
  335. :total="total"
  336. :page.sync="queryParams.pageNum"
  337. :limit.sync="queryParams.pageSize"
  338. @pagination="getList"
  339. />
  340. <!-- 添加或修改仓库主(出入库)对话框 -->
  341. <el-dialog
  342. :title="title"
  343. :visible.sync="open"
  344. :close-on-click-modal="false"
  345. width="80%"
  346. append-to-body
  347. :show-close="colseButton"
  348. >
  349. <el-form ref="form" :model="form" :rules="rules" label-width="120px">
  350. <el-row>
  351. <el-col :span="8">
  352. <el-form-item label="货权方" prop="fCorpid">
  353. <el-select
  354. v-model="form.fCorpid"
  355. filterable
  356. remote
  357. :disabled="notChange || formBrowseStatus"
  358. style="width: 80%"
  359. :remote-method="corpsRemoteMethod"
  360. placeholder="请选择货权方"
  361. >
  362. <el-option
  363. v-for="(dict, index) in fMblnoOptions"
  364. :key="index.fId"
  365. :label="dict.fName"
  366. :value="dict.fId"
  367. ></el-option>
  368. </el-select>
  369. </el-form-item>
  370. </el-col>
  371. <el-col :span="8">
  372. <el-form-item label="新货权方" prop="fTocorpid">
  373. <el-select
  374. v-model="form.fTocorpid"
  375. filterable
  376. remote
  377. :disabled="notChange || formBrowseStatus"
  378. style="width: 80%"
  379. @change="changefCorpid(form)"
  380. :remote-method="corpsRemoteMethod"
  381. placeholder="请选择新货权方"
  382. >
  383. <el-option
  384. v-for="(dict, index) in fMblnoOptions"
  385. :key="index.fId"
  386. :label="dict.fName"
  387. :value="dict.fId"
  388. ></el-option>
  389. </el-select>
  390. </el-form-item>
  391. </el-col>
  392. <el-col :span="8">
  393. <el-form-item label="业务编号" prop="fBillno">
  394. <el-input
  395. v-model="form.fBillno"
  396. style="width: 80%"
  397. disabled
  398. placeholder="业务编号"
  399. />
  400. </el-form-item>
  401. </el-col>
  402. </el-row>
  403. <el-row>
  404. <el-col :span="8">
  405. <el-form-item label="货转日期" prop="fBsdate">
  406. <el-date-picker
  407. v-model="form.fBsdate"
  408. style="width: 80%"
  409. type="date"
  410. :disabled="notChange || formBrowseStatus"
  411. value-format="timestamp"
  412. placeholder="货转日期"
  413. >
  414. </el-date-picker>
  415. </el-form-item>
  416. </el-col>
  417. <el-col :span="8">
  418. <el-form-item label="仓储计费日期" prop="fChargedate">
  419. <el-date-picker
  420. v-model="form.fChargedate"
  421. style="width: 80%"
  422. type="date"
  423. :disabled="notChange || formBrowseStatus"
  424. value-format="timestamp"
  425. placeholder="仓储计费日期">
  426. </el-date-picker>
  427. </el-form-item>
  428. </el-col>
  429. <el-col :span="8">
  430. <el-form-item label="仓库" prop="fWarehouseid">
  431. <el-select
  432. v-model="form.fWarehouseid"
  433. filterable
  434. :disabled="notChange || formBrowseStatus"
  435. remote
  436. style="width: 80%"
  437. :remote-method="warehouseRemoteMethod"
  438. placeholder="请选择仓库">
  439. <el-option
  440. v-for="(dict, index) in warehouseOptions"
  441. :key="index.fId"
  442. :label="dict.fName"
  443. :value="dict.fId"
  444. ></el-option>
  445. </el-select>
  446. </el-form-item>
  447. </el-col>
  448. </el-row>
  449. <el-row>
  450. <el-col :span="8">
  451. <el-form-item label="结算方式" prop="fStltypeid">
  452. <el-select
  453. v-model="form.fStltypeid"
  454. placeholder="请选择结算方式"
  455. clearable
  456. :disabled="notChange || formBrowseStatus"
  457. style="width: 80%"
  458. >
  459. <el-option
  460. v-for="(dict, index) in fStltypeOptions"
  461. :key="index.dictValue"
  462. :label="dict.dictLabel"
  463. :value="dict.dictValue"
  464. />
  465. </el-select>
  466. </el-form-item>
  467. </el-col>
  468. <el-col :span="8">
  469. <el-form-item label="计费单位" prop="fFeetunit">
  470. <el-select
  471. v-model="form.fFeetunit"
  472. placeholder="请选择计费单位"
  473. clearable
  474. :disabled="notChange || formBrowseStatus"
  475. style="width: 80%"
  476. >
  477. <el-option
  478. v-for="(dict, index) in fFeetunitOptions"
  479. :key="index.dictValue"
  480. :label="dict.dictLabel"
  481. :value="dict.dictValue"
  482. />
  483. </el-select>
  484. </el-form-item>
  485. </el-col>
  486. <el-col :span="8">
  487. <el-form-item label="贸易方式" prop="fTrademodeid">
  488. <el-select
  489. v-model="form.fTrademodeid"
  490. placeholder="请选择贸易方式"
  491. clearable
  492. :disabled="notChange || formBrowseStatus"
  493. style="width: 80%"
  494. >
  495. <el-option
  496. v-for="(dict, index) in fTrademodeidOptions"
  497. :key="index.dictValue"
  498. :label="dict.dictLabel"
  499. :value="dict.dictValue"
  500. />
  501. </el-select>
  502. </el-form-item>
  503. </el-col>
  504. </el-row>
  505. <el-row>
  506. <el-col :span="8">
  507. <el-form-item label="提单号" prop="fMblno">
  508. <el-input
  509. v-model="form.fMblno"
  510. disabled
  511. style="width: 80%"
  512. placeholder=""
  513. />
  514. </el-form-item>
  515. </el-col>
  516. <el-col :span="8">
  517. <el-form-item label="原始入库单号" prop="fOriginalbillno">
  518. <el-input
  519. v-model="form.fOriginalbillno"
  520. style="width: 80%"
  521. :disabled="notChange"
  522. placeholder="原始入库单号"
  523. />
  524. </el-form-item>
  525. </el-col>
  526. <el-col :span="8">
  527. <el-form-item label="原始入库日期" prop="orgStorageDate">
  528. <el-date-picker
  529. v-model="orgStorageDate"
  530. type="daterange"
  531. value-format="yyyy-MM-dd"
  532. range-separator="至"
  533. style="width: 80%"
  534. :disabled="notChange"
  535. start-placeholder="开始日期"
  536. end-placeholder="结束日期"
  537. >
  538. </el-date-picker>
  539. </el-form-item>
  540. </el-col>
  541. </el-row>
  542. <el-row>
  543. <el-col :span="8">
  544. <el-form-item label="品牌" prop="fMarks">
  545. <el-input
  546. v-model="form.fMarks"
  547. style="width: 80%"
  548. disabled
  549. placeholder="品牌"
  550. />
  551. </el-form-item>
  552. </el-col>
  553. <el-col :span="8">
  554. <el-form-item label="品名" prop="fProductName">
  555. <el-input
  556. v-model="form.fProductName"
  557. style="width: 80%"
  558. disabled
  559. placeholder="品名"
  560. />
  561. </el-form-item>
  562. </el-col>
  563. <el-col :span="8">
  564. <el-form-item label="制单人" prop="createBy">
  565. <el-input
  566. disabled
  567. v-model="form.createBy"
  568. style="width: 80%"
  569. placeholder="制单人"
  570. />
  571. </el-form-item>
  572. </el-col>
  573. </el-row>
  574. <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
  575. <el-button type="primary" :disabled="notChange" @click="submitForm">请 核</el-button>
  576. </el-form>
  577. <div class="dialogTableTitle flex a-center jlr">
  578. <h3>货转明细</h3>
  579. <el-button :disabled="browseStatus" @click.prevent="addRelevant()"
  580. >新增
  581. </el-button
  582. >
  583. <el-button
  584. :disabled="dataListSelection.length <= 0 || browseStatus"
  585. @click.prevent="creditClick()"
  586. >货转确认
  587. </el-button>
  588. <el-button
  589. :disabled="dataWithdrawList.length <= 0 || browseStatus"
  590. @click.prevent="withdrawClick"
  591. >撤回货转
  592. </el-button
  593. >
  594. <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
  595. </div>
  596. <el-table
  597. :data="dataList"
  598. ref="tableListRef"
  599. tooltip-effect="dark"
  600. border
  601. stripe
  602. :summary-method="getSummaries"
  603. @selection-change="Selectinventory"
  604. show-summary
  605. >
  606. <el-table-column type="selection" width="55" align="center"/>
  607. <el-table-column label="序号" type="index" width="80">
  608. </el-table-column>
  609. <el-table-column
  610. prop="fGoodsids"
  611. header-align="center"
  612. align="center"
  613. width="140px"
  614. label="品名"
  615. >
  616. </el-table-column>
  617. <el-table-column
  618. prop="fMarks"
  619. header-align="center"
  620. align="center"
  621. width="140px"
  622. label="品牌"
  623. >
  624. </el-table-column>
  625. <el-table-column
  626. prop="fBusinessType"
  627. header-align="center"
  628. width="140px"
  629. align="center"
  630. label="*货物属性"
  631. >
  632. <template slot-scope="scope">
  633. <el-select v-model="scope.row.fBusinessType"
  634. filterable
  635. disabled
  636. placeholder="请选择商品属性"
  637. >
  638. <el-option
  639. v-for="(dict, index) in fStorageTypeOptions"
  640. :key="index.dictValue"
  641. :label="dict.dictLabel"
  642. :value="dict.dictValue"
  643. />
  644. </el-select>
  645. </template>
  646. </el-table-column>
  647. <el-table-column
  648. prop="fMarks"
  649. header-align="center"
  650. align="center"
  651. width="140px"
  652. label="*属性详情"
  653. >
  654. </el-table-column>
  655. <el-table-column
  656. prop="fMblno"
  657. header-align="center"
  658. align="center"
  659. width="140px"
  660. label="提单号"
  661. >
  662. </el-table-column>
  663. <el-table-column
  664. prop="fWarehouseids"
  665. header-align="center"
  666. width="150px"
  667. align="center"
  668. label="*仓库"
  669. >
  670. </el-table-column>
  671. <el-table-column
  672. prop="fWarehouselocids"
  673. header-align="center"
  674. width="150px"
  675. align="center"
  676. label="*库区"
  677. >
  678. </el-table-column>
  679. <el-table-column
  680. prop="fOriginalbillno"
  681. header-align="center"
  682. align="center"
  683. width="140px"
  684. label="原始入库单号"
  685. >
  686. </el-table-column>
  687. <el-table-column
  688. prop="fPlanqty"
  689. header-align="center"
  690. align="center"
  691. width="180px"
  692. label="*结余件数"
  693. >
  694. </el-table-column>
  695. <el-table-column
  696. prop="fPlangrossweight"
  697. header-align="center"
  698. align="center"
  699. width="180px"
  700. label="*库存毛重"
  701. >
  702. </el-table-column>
  703. <el-table-column
  704. prop="fPlannetweight"
  705. header-align="center"
  706. width="180px"
  707. align="center"
  708. label="*库存净重"
  709. >
  710. </el-table-column>
  711. <el-table-column
  712. prop="fQty"
  713. header-align="center"
  714. width="180px"
  715. align="center"
  716. label="*货转件数"
  717. >
  718. <template slot-scope="scope">
  719. <el-input
  720. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  721. @change="qtyChange(scope.row)"
  722. v-model="scope.row.fQty"
  723. placeholder="*货转件数"
  724. :disabled="browseStatus || scope.row.fBillstatus === 6"
  725. show-word-limit
  726. />
  727. </template>
  728. </el-table-column>
  729. <el-table-column
  730. prop="fGrossweight"
  731. header-align="center"
  732. width="180px"
  733. align="center"
  734. label="*货转毛重"
  735. >
  736. <template slot-scope="scope">
  737. <el-input
  738. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
  739. :disabled="browseStatus || scope.row.fBillstatus === 6"
  740. @change="changeTransfer(scope.row)"
  741. v-model="scope.row.fGrossweight"
  742. placeholder="货转毛重"
  743. show-word-limit
  744. />
  745. </template>
  746. </el-table-column>
  747. <el-table-column
  748. prop="fNetweight"
  749. header-align="center"
  750. width="180px"
  751. align="center"
  752. label="*货转净重"
  753. >
  754. <template slot-scope="scope">
  755. <el-input
  756. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d\d\d).*$/, "$1$2.$3")'
  757. :disabled="browseStatus || scope.row.fBillstatus === 6"
  758. v-model="scope.row.fNetweight"
  759. @change="changeTransfer(scope.row)"
  760. placeholder="货转净重"
  761. show-word-limit
  762. />
  763. </template>
  764. </el-table-column>
  765. <el-table-column
  766. prop="fCntqty"
  767. header-align="center"
  768. width="180px"
  769. align="center"
  770. label="箱量"
  771. >
  772. <template slot-scope="scope">
  773. <el-input
  774. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  775. v-model="scope.row.fCntqty"
  776. placeholder="箱量"
  777. :disabled="browseStatus || scope.row.fBillstatus === 6"
  778. show-word-limit
  779. />
  780. </template>
  781. </el-table-column>
  782. <el-table-column
  783. prop="fPackagespecs"
  784. header-align="center"
  785. width="180px"
  786. align="center"
  787. label="*包装规格"
  788. >
  789. <template slot-scope="scope">
  790. <el-input
  791. v-model="scope.row.fPackagespecs"
  792. :disabled="browseStatus || scope.row.fBillstatus === 6"
  793. placeholder="包装规格"
  794. show-word-limit
  795. />
  796. </template>
  797. </el-table-column>
  798. <el-table-column
  799. prop="fGoodsval"
  800. header-align="center"
  801. width="150px"
  802. align="center"
  803. label="货值"
  804. >
  805. <template slot-scope="scope">
  806. <el-input
  807. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  808. v-model="scope.row.fGoodsval"
  809. placeholder="货值"
  810. :disabled="browseStatus || scope.row.fBillstatus === 6"
  811. show-word-limit
  812. />
  813. </template>
  814. </el-table-column>
  815. <el-table-column
  816. prop="remark"
  817. header-align="center"
  818. width="150px"
  819. align="center"
  820. label="备注"
  821. >
  822. <template slot-scope="scope">
  823. <el-input
  824. v-model="scope.row.remark"
  825. placeholder="备注"
  826. :disabled="browseStatus || scope.row.fBillstatus === 6"
  827. show-word-limit
  828. />
  829. </template>
  830. </el-table-column>
  831. <el-table-column
  832. prop="fBillstatus"
  833. header-align="center"
  834. width="150px"
  835. align="center"
  836. label="状态"
  837. >
  838. <template slot-scope="scope">
  839. <span v-if="scope.row.fBillstatus === 6">货转</span>
  840. <span v-else>录入</span>
  841. </template>
  842. </el-table-column>
  843. <el-table-column
  844. header-align="center"
  845. align="center"
  846. label="操作"
  847. width="130PX"
  848. >
  849. <template slot-scope="scope">
  850. <el-button
  851. :disabled="browseStatus || scope.row.fBillstatus === 6"
  852. @click.native.prevent="deleteRow(scope.$index, dataList)"
  853. size="small"
  854. >移除
  855. </el-button
  856. >
  857. </template>
  858. </el-table-column>
  859. </el-table>
  860. <div class="dialogTableTitle flex a-center jlr">
  861. <h3>附件上传</h3>
  862. <el-button :disabled="browseStatus" @click.prevent="addRelevt()"
  863. >新增
  864. </el-button>
  865. <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
  866. </div>
  867. <el-table
  868. :data="relevantAttachments"
  869. ref="attachTable"
  870. tooltip-effect="dark"
  871. border
  872. stripe
  873. style="width: 100%"
  874. height="150"
  875. >
  876. <el-table-column label="序号" type="index" width="80">
  877. </el-table-column>
  878. <el-table-column
  879. prop="fName"
  880. header-align="center"
  881. align="center"
  882. label="附件名称"
  883. >
  884. <template slot-scope="scope">
  885. <el-input
  886. v-model="scope.row.fName"
  887. :disabled="browseStatus"
  888. placeholder="附件名称"
  889. show-word-limit
  890. />
  891. </template>
  892. </el-table-column>
  893. <el-table-column
  894. prop="createBy"
  895. header-align="center"
  896. align="center"
  897. label="上传人"
  898. >
  899. <template slot-scope="scope">
  900. <el-input
  901. v-model="scope.row.createBy"
  902. :disabled="browseStatus"
  903. placeholder="上传人"
  904. show-word-limit
  905. />
  906. </template>
  907. </el-table-column>
  908. <el-table-column
  909. prop="createTime"
  910. header-align="center"
  911. align="center"
  912. label="上传时间"
  913. >
  914. <template slot-scope="scope">
  915. <el-date-picker
  916. v-model="scope.row.createTime"
  917. type="date"
  918. disabled
  919. placeholder="上传时间"
  920. format="yyyy-MM-dd HH:mm"
  921. value-format="timestamp"
  922. ></el-date-picker>
  923. </template>
  924. </el-table-column>
  925. <el-table-column
  926. prop="fUrl"
  927. header-align="center"
  928. align="center"
  929. width="80%"
  930. label="上传附件"
  931. >
  932. <template slot-scope="scope">
  933. <uploadFile @input="showFile" v-model="scope.row.fUrl"/>
  934. </template>
  935. </el-table-column>
  936. <el-table-column
  937. header-align="center"
  938. align="center"
  939. label="操作"
  940. width="130PX"
  941. >
  942. <template slot-scope="scope">
  943. <el-button
  944. @click.native.prevent="
  945. deleteRow(scope.$index, relevantAttachments)
  946. "
  947. :disabled="browseStatus"
  948. size="small"
  949. >移除
  950. </el-button>
  951. </template>
  952. </el-table-column>
  953. </el-table>
  954. <div class="dialogTableTitle flex a-center jlr">
  955. <h3>收款信息</h3>
  956. <el-button :disabled="browseStatus" @click.prevent="addCollection()"
  957. >新增
  958. </el-button>
  959. <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
  960. </div>
  961. <el-table
  962. :data="warehouseDrList"
  963. ref="warehouseDr"
  964. tooltip-effect="dark"
  965. border
  966. stripe
  967. :summary-method="warehouseDrSummaries"
  968. show-summary
  969. >
  970. <el-table-column label="序号" type="index" width="80">
  971. </el-table-column>
  972. <el-table-column
  973. prop="fCorpid"
  974. header-align="center"
  975. align="center"
  976. width="180px"
  977. label="客户名称"
  978. >
  979. <template slot-scope="scope">
  980. <el-select
  981. v-model="scope.row.fCorpid"
  982. filterable
  983. remote
  984. :disabled="browseStatus"
  985. :remote-method="corpsRemoteMethod"
  986. placeholder="客户名称"
  987. >
  988. <el-option
  989. v-for="(dict, index) in KHblnoOptions"
  990. :key="index.fId"
  991. :label="dict.fName"
  992. :value="dict.fId"
  993. ></el-option>
  994. </el-select>
  995. </template>
  996. </el-table-column>
  997. <el-table-column
  998. prop="fFeeid"
  999. header-align="center"
  1000. align="center"
  1001. width="180px"
  1002. label="费用名称"
  1003. >
  1004. <template slot-scope="scope">
  1005. <el-select
  1006. :disabled="browseStatus"
  1007. v-model="scope.row.fFeeid"
  1008. filterable
  1009. remote
  1010. :remote-method="fWRemoteMethod"
  1011. @change="changeFeeId(scope.row)"
  1012. placeholder="费用名称"
  1013. >
  1014. <el-option
  1015. v-for="(dict, index) in fWbuOptions"
  1016. :key="index.fId"
  1017. :label="dict.fName"
  1018. :value="dict.fId"
  1019. ></el-option>
  1020. </el-select>
  1021. </template>
  1022. </el-table-column>
  1023. <el-table-column
  1024. prop="fFeeunitid"
  1025. header-align="center"
  1026. align="center"
  1027. width="180px"
  1028. label="计价单位"
  1029. >
  1030. <template slot-scope="scope">
  1031. <el-select
  1032. v-model="scope.row.fFeeunitid"
  1033. placeholder="请选择计价单位"
  1034. :disabled="browseStatus"
  1035. @change="changeFeeUnit(scope.row)"
  1036. clearable
  1037. >
  1038. <el-option
  1039. v-for="(dict, index) in fFeetunitOptions"
  1040. :key="index.dictValue"
  1041. :label="dict.dictLabel"
  1042. :value="dict.dictValue"
  1043. />
  1044. </el-select>
  1045. </template>
  1046. </el-table-column>
  1047. <el-table-column
  1048. prop="fQty"
  1049. header-align="center"
  1050. align="center"
  1051. width="150px"
  1052. label="数量"
  1053. >
  1054. <template slot-scope="scope">
  1055. <el-input
  1056. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  1057. v-model="scope.row.fQty"
  1058. placeholder="数量"
  1059. :disabled="browseStatus"
  1060. @change="changeContractAmt(scope.row)"
  1061. show-word-limit
  1062. />
  1063. </template>
  1064. </el-table-column>
  1065. <el-table-column
  1066. prop="fUnitprice"
  1067. header-align="center"
  1068. align="center"
  1069. width="150px"
  1070. label="单价"
  1071. >
  1072. <template slot-scope="scope">
  1073. <el-input
  1074. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  1075. v-model="scope.row.fUnitprice"
  1076. placeholder="单价"
  1077. :disabled="browseStatus"
  1078. @change="changeContractAmt(scope.row)"
  1079. show-word-limit
  1080. />
  1081. </template>
  1082. </el-table-column>
  1083. <el-table-column
  1084. prop="fAmount"
  1085. header-align="center"
  1086. align="center"
  1087. width="150px"
  1088. label="金额"
  1089. >
  1090. <template slot-scope="scope">
  1091. <el-input
  1092. disabled
  1093. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  1094. v-model="scope.row.fAmount"
  1095. placeholder="金额"
  1096. show-word-limit
  1097. />
  1098. </template>
  1099. </el-table-column>
  1100. <el-table-column
  1101. prop="fCurrency"
  1102. header-align="center"
  1103. align="center"
  1104. width="150px"
  1105. label="币别"
  1106. >
  1107. <template slot-scope="scope">
  1108. <el-input
  1109. v-model="scope.row.fCurrency"
  1110. :disabled="browseStatus"
  1111. placeholder="币别"
  1112. show-word-limit
  1113. />
  1114. </template>
  1115. </el-table-column>
  1116. <el-table-column
  1117. prop="fExrate"
  1118. header-align="center"
  1119. align="center"
  1120. width="150px"
  1121. label="汇率"
  1122. >
  1123. <template slot-scope="scope">
  1124. <el-input
  1125. v-model="scope.row.fExrate"
  1126. :disabled="browseStatus"
  1127. placeholder="汇率"
  1128. show-word-limit
  1129. />
  1130. </template>
  1131. </el-table-column>
  1132. <el-table-column
  1133. prop="fTaxrate"
  1134. header-align="center"
  1135. align="center"
  1136. width="150px"
  1137. label="税率"
  1138. >
  1139. <template slot-scope="scope">
  1140. <el-input
  1141. v-model="scope.row.fTaxrate"
  1142. :disabled="browseStatus"
  1143. placeholder="税率"
  1144. show-word-limit
  1145. />
  1146. </template>
  1147. </el-table-column>
  1148. <el-table-column
  1149. prop="fMblno"
  1150. header-align="center"
  1151. align="center"
  1152. width="130px"
  1153. label="提单号"
  1154. >
  1155. <template slot-scope="scope">
  1156. <el-input
  1157. v-model="scope.row.fMblno"
  1158. :disabled="browseStatus"
  1159. placeholder="提单号"
  1160. show-word-limit
  1161. />
  1162. </template>
  1163. </el-table-column>
  1164. <el-table-column
  1165. prop="fProductName"
  1166. header-align="center"
  1167. align="center"
  1168. width="140px"
  1169. label="品名"
  1170. >
  1171. <template slot-scope="scope">
  1172. <el-input
  1173. v-model="scope.row.fProductName"
  1174. :disabled="browseStatus"
  1175. placeholder="品名"
  1176. show-word-limit
  1177. />
  1178. </template>
  1179. </el-table-column>
  1180. <el-table-column
  1181. prop="fMarks"
  1182. header-align="center"
  1183. align="center"
  1184. width="130px"
  1185. label="品牌"
  1186. >
  1187. <template slot-scope="scope">
  1188. <el-input
  1189. v-model="scope.row.fMarks"
  1190. :disabled="browseStatus"
  1191. placeholder="品牌"
  1192. show-word-limit
  1193. />
  1194. </template>
  1195. </el-table-column>
  1196. <el-table-column
  1197. prop="remarks"
  1198. header-align="center"
  1199. align="center"
  1200. width="150px"
  1201. label="备注"
  1202. >
  1203. <template slot-scope="scope">
  1204. <el-input
  1205. v-model="scope.row.remarks"
  1206. :disabled="browseStatus"
  1207. placeholder="备注"
  1208. show-word-limit
  1209. />
  1210. </template>
  1211. </el-table-column>
  1212. <el-table-column
  1213. header-align="center"
  1214. align="center"
  1215. label="操作"
  1216. width="150px"
  1217. >
  1218. <template slot-scope="scope">
  1219. <el-button size="small">审核费用</el-button>
  1220. <el-button
  1221. @click.native.prevent="deleteRow(scope.$index, warehouseDrList)"
  1222. size="small"
  1223. >移除
  1224. </el-button
  1225. >
  1226. </template>
  1227. </el-table-column>
  1228. </el-table>
  1229. <div class="dialogTableTitle flex a-center jlr">
  1230. <h3>付款信息</h3>
  1231. <el-button :disabled="browseStatus" @click.prevent="addpayment()"
  1232. >新增
  1233. </el-button>
  1234. <el-button type="primary" :disabled="browseStatus" @click="saveForm">保 存</el-button>
  1235. </div>
  1236. <el-table
  1237. :data="warehouseCrList"
  1238. ref="warehouseCr"
  1239. tooltip-effect="dark"
  1240. border
  1241. stripe
  1242. :summary-method="warehouseDrSummaries"
  1243. show-summary
  1244. >
  1245. <el-table-column label="序号" type="index" width="80">
  1246. </el-table-column>
  1247. <el-table-column
  1248. prop="fCorpid"
  1249. header-align="center"
  1250. align="center"
  1251. width="180px"
  1252. label="客户名称"
  1253. >
  1254. <template slot-scope="scope">
  1255. <el-select
  1256. v-model="scope.row.fCorpid"
  1257. filterable
  1258. remote
  1259. :disabled="browseStatus"
  1260. :remote-method="corpsRemoteMethod"
  1261. placeholder="客户名称"
  1262. >
  1263. <el-option
  1264. v-for="(dict, index) in KHblnoOptions"
  1265. :key="index.fId"
  1266. :label="dict.fName"
  1267. :value="dict.fId"
  1268. ></el-option>
  1269. </el-select>
  1270. </template>
  1271. </el-table-column>
  1272. <el-table-column
  1273. prop="fFeeid"
  1274. header-align="center"
  1275. align="center"
  1276. width="180px"
  1277. label="费用名称"
  1278. >
  1279. <template slot-scope="scope">
  1280. <el-select
  1281. v-model="scope.row.fFeeid"
  1282. filterable
  1283. remote
  1284. :disabled="browseStatus"
  1285. :remote-method="fWRemoteMethod"
  1286. @change="changeFeeId(scope.row)"
  1287. placeholder="费用名称"
  1288. >
  1289. <el-option
  1290. v-for="(dict, index) in fWbuOptions"
  1291. :key="index.fId"
  1292. :label="dict.fName"
  1293. :value="dict.fId"
  1294. ></el-option>
  1295. </el-select>
  1296. </template>
  1297. </el-table-column>
  1298. <el-table-column
  1299. prop="fFeeunitid"
  1300. header-align="center"
  1301. align="center"
  1302. width="180px"
  1303. label="计价单位"
  1304. >
  1305. <template slot-scope="scope">
  1306. <el-select
  1307. v-model="scope.row.fFeeunitid"
  1308. filterable
  1309. remote
  1310. :disabled="browseStatus"
  1311. @change="changeFeeUnit(scope.row)"
  1312. :remote-method="corpsRemoteMethod"
  1313. placeholder="计价单位"
  1314. >
  1315. <el-option
  1316. v-for="(dict, index) in fFeetunitOptions"
  1317. :key="index.dictValue"
  1318. :label="dict.dictLabel"
  1319. :value="dict.dictValue"
  1320. ></el-option>
  1321. </el-select>
  1322. </template>
  1323. </el-table-column>
  1324. <el-table-column
  1325. prop="fQty"
  1326. header-align="center"
  1327. align="center"
  1328. width="150px"
  1329. label="数量"
  1330. >
  1331. <template slot-scope="scope">
  1332. <el-input
  1333. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, "$1$2.$3")'
  1334. v-model="scope.row.fQty"
  1335. :disabled="browseStatus"
  1336. @change="changeContractAmt(scope.row)"
  1337. placeholder="数量"
  1338. show-word-limit
  1339. />
  1340. </template>
  1341. </el-table-column>
  1342. <el-table-column
  1343. prop="fUnitprice"
  1344. header-align="center"
  1345. align="center"
  1346. width="150px"
  1347. label="单价"
  1348. >
  1349. <template slot-scope="scope">
  1350. <el-input
  1351. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  1352. v-model="scope.row.fUnitprice"
  1353. :disabled="browseStatus"
  1354. @change="changeContractAmt(scope.row)"
  1355. placeholder="单价"
  1356. show-word-limit
  1357. />
  1358. </template>
  1359. </el-table-column>
  1360. <el-table-column
  1361. prop="fAmount"
  1362. header-align="center"
  1363. align="center"
  1364. width="150px"
  1365. label="金额"
  1366. >
  1367. <template slot-scope="scope">
  1368. <el-input
  1369. disabled
  1370. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  1371. v-model="scope.row.fAmount"
  1372. placeholder="金额"
  1373. show-word-limit
  1374. />
  1375. </template>
  1376. </el-table-column>
  1377. <el-table-column
  1378. prop="fCurrency"
  1379. header-align="center"
  1380. align="center"
  1381. width="150px"
  1382. label="币别"
  1383. >
  1384. <template slot-scope="scope">
  1385. <el-input
  1386. v-model="scope.row.fCurrency"
  1387. :disabled="browseStatus"
  1388. placeholder="币别"
  1389. show-word-limit
  1390. />
  1391. </template>
  1392. </el-table-column>
  1393. <el-table-column
  1394. prop="fExrate"
  1395. header-align="center"
  1396. align="center"
  1397. width="150px"
  1398. label="汇率"
  1399. >
  1400. <template slot-scope="scope">
  1401. <el-input
  1402. v-model="scope.row.fExrate"
  1403. :disabled="browseStatus"
  1404. placeholder="汇率"
  1405. show-word-limit
  1406. />
  1407. </template>
  1408. </el-table-column>
  1409. <el-table-column
  1410. prop="fTaxrate"
  1411. header-align="center"
  1412. align="center"
  1413. width="150px"
  1414. label="税率"
  1415. >
  1416. <template slot-scope="scope">
  1417. <el-input
  1418. v-model="scope.row.fTaxrate"
  1419. :disabled="browseStatus"
  1420. placeholder="税率"
  1421. show-word-limit
  1422. />
  1423. </template>
  1424. </el-table-column>
  1425. <el-table-column
  1426. prop="fMblno"
  1427. header-align="center"
  1428. align="center"
  1429. width="130px"
  1430. label="提单号"
  1431. >
  1432. <template slot-scope="scope">
  1433. <el-input
  1434. v-model="scope.row.fMblno"
  1435. :disabled="browseStatus"
  1436. placeholder="提单号"
  1437. show-word-limit
  1438. />
  1439. </template>
  1440. </el-table-column>
  1441. <el-table-column
  1442. prop="fProductName"
  1443. header-align="center"
  1444. align="center"
  1445. width="140px"
  1446. label="品名"
  1447. >
  1448. <template slot-scope="scope">
  1449. <el-input
  1450. v-model="scope.row.fProductName"
  1451. :disabled="browseStatus"
  1452. placeholder="品名"
  1453. show-word-limit
  1454. />
  1455. </template>
  1456. </el-table-column>
  1457. <el-table-column
  1458. prop="fMarks"
  1459. header-align="center"
  1460. align="center"
  1461. width="130px"
  1462. label="品牌"
  1463. >
  1464. <template slot-scope="scope">
  1465. <el-input
  1466. v-model="scope.row.fMarks"
  1467. :disabled="browseStatus"
  1468. placeholder="品牌"
  1469. show-word-limit
  1470. />
  1471. </template>
  1472. </el-table-column>
  1473. <el-table-column
  1474. prop="remarks"
  1475. header-align="center"
  1476. align="center"
  1477. width="150px"
  1478. label="备注"
  1479. >
  1480. <template slot-scope="scope">
  1481. <el-input
  1482. v-model="scope.row.remarks"
  1483. :disabled="browseStatus"
  1484. placeholder="备注"
  1485. show-word-limit
  1486. />
  1487. </template>
  1488. </el-table-column>
  1489. <el-table-column
  1490. header-align="center"
  1491. align="center"
  1492. width="150px"
  1493. label="操作"
  1494. >
  1495. <template slot-scope="scope">
  1496. <el-button size="small">审核费用</el-button>
  1497. <el-button
  1498. @click.native.prevent="deleteRow(scope.$index, warehouseCrList)"
  1499. :disabled="browseStatus"
  1500. size="small"
  1501. >移除
  1502. </el-button
  1503. >
  1504. </template>
  1505. </el-table-column>
  1506. </el-table>
  1507. <div slot="footer" class="dialog-footer">
  1508. <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  1509. <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>
  1510. <el-button type="primary" :disabled="notChange" @click="saveForm">保 存</el-button>
  1511. <el-button v-if="approve === true" @click="goApproval">审批</el-button>
  1512. <el-button type="success" @click="backrRconciliation" v-if="form.fBillstatus == '6'">撤销请核</el-button>
  1513. <el-button type="primary" :disabled="approvalStatus" v-if="form.fBillstatus > 3" @click="addOrUpdateHandle()">查看审批流</el-button>
  1514. <el-button type="primary" :disabled="notChange" @click="submitForm">提交审核</el-button>
  1515. <el-button type="danger" :disabled="disappear" v-if="form.fBillstatus == '4' && Operator == Lander" @click="backApproval">撤销审批</el-button>
  1516. <el-button v-if="cancelButton === true" @click="cancel">取 消</el-button>
  1517. <el-button v-if="cancelButton === false" @click="homePage">取消</el-button>
  1518. </div>
  1519. <!-- 选择库存总账数据 -->
  1520. <el-dialog
  1521. title="库存总账"
  1522. :modal="false"
  1523. style="box-shadow: 0 1px 3px rgba(0, 0, 0, 0) !important"
  1524. :visible.sync="whgenlegVisible"
  1525. :close-on-click-modal="false"
  1526. width="70%"
  1527. >
  1528. <el-table
  1529. :data="whgenlegList"
  1530. ref="tableList"
  1531. tooltip-effect="dark"
  1532. width="100%"
  1533. border
  1534. stripe
  1535. @selection-change="whgenlegSelectionChange"
  1536. >
  1537. <el-table-column type="selection" width="55"></el-table-column>
  1538. <el-table-column
  1539. prop="fMblno"
  1540. header-align="center"
  1541. align="center"
  1542. label="提单号"
  1543. >
  1544. </el-table-column>
  1545. <el-table-column
  1546. prop="createTime"
  1547. header-align="center"
  1548. align="center"
  1549. width="180px"
  1550. label="入库日期"
  1551. >
  1552. </el-table-column>
  1553. <el-table-column
  1554. prop="fGoodsids"
  1555. header-align="center"
  1556. align="center"
  1557. label="品名"
  1558. >
  1559. </el-table-column>
  1560. <el-table-column
  1561. prop="fQtyblc"
  1562. header-align="center"
  1563. align="center"
  1564. label="结余数量"
  1565. >
  1566. </el-table-column>
  1567. <el-table-column
  1568. prop="fWarehouseids"
  1569. header-align="center"
  1570. align="center"
  1571. label="仓库"
  1572. >
  1573. </el-table-column>
  1574. <el-table-column
  1575. prop="fWarehouseLocationids"
  1576. header-align="center"
  1577. align="center"
  1578. label="库区"
  1579. >
  1580. </el-table-column>
  1581. </el-table>
  1582. <pagination
  1583. v-show="whgenlegTotal > 0"
  1584. :total="whgenlegTotal"
  1585. :page.sync="whgenlegParams.pageNum"
  1586. :limit.sync="whgenlegParams.pageSize"
  1587. @pagination="getWhgenlegList"
  1588. />
  1589. <div slot="footer" class="dialog-footer">
  1590. <el-button type="primary" @click="whgenlegData">导入</el-button>
  1591. <el-button @click="whgenlegVisible = false">取 消</el-button>
  1592. </div>
  1593. </el-dialog>
  1594. </el-dialog>
  1595. </div>
  1596. </template>
  1597. <script>
  1598. import print from 'print-js'
  1599. import {
  1600. backFee,
  1601. RevocationApproval,
  1602. addWhgenleg,
  1603. listGoodsTransfer,
  1604. getGoodsTransfer,
  1605. addGoodsTransfer,
  1606. warehouseSubmission,
  1607. delGoodsTransfer,
  1608. exportGoodsTransfer
  1609. } from '@/api/warehouseBusiness/goodsTransfer'
  1610. import { updateCredit } from '@/api/warehouseBusiness/goodsTransfer'
  1611. import { listCorps } from '@/api/basicdata/corps'
  1612. import { listFees } from '@/api/basicdata/fees'
  1613. import { listWarehouse } from '@/api/basicdata/warehouse'
  1614. import { listArea } from '@/api/basicdata/area'
  1615. import { listGoods } from '@/api/basicdata/goods'
  1616. import { listUser, queryUserVal } from '@/api/system/user'
  1617. import { listWhgenleg } from '@/api/reportManagement/whgenleg'
  1618. import UploadFile from '@/components/Uploadfile'
  1619. import AddOrUpdate from '@/views/viewApproval'
  1620. import ApprovalComments from '@/views/startApproval'
  1621. import Global from '@/layout/components/global'
  1622. import { getAgreement } from '@/api/warehouseBusiness/agreement'
  1623. export default {
  1624. name: 'goodsTransfer',
  1625. components: {
  1626. UploadFile,
  1627. AddOrUpdate,
  1628. ApprovalComments
  1629. },
  1630. data() {
  1631. return {
  1632. Lander:'',
  1633. Operator:'',
  1634. colseButton:true,
  1635. cancelButton:true,
  1636. disappear:false,
  1637. goodsTransferId:130,
  1638. addOrUpdateVisible: false,
  1639. addOrUpdateVisib:false,
  1640. approvalStatus: false,
  1641. // 审批状态
  1642. approve:false,
  1643. notChange:false,
  1644. // 修改查看状态
  1645. browseStatus: false,
  1646. // 是否有明细入库
  1647. formBrowseStatus: false,
  1648. // 遮罩层
  1649. loading: true,
  1650. // 选中数组
  1651. ids: [],
  1652. userVal: {
  1653. userName: null,
  1654. nickName: null,
  1655. deptId: null
  1656. },
  1657. queryForm: {},
  1658. // 添加用户对话框
  1659. editDialogVisible_s: false,
  1660. editDialogVisible_ss: false,
  1661. editDialogClosed_ss: false,
  1662. dataList: [],
  1663. warehouseCrList: [],
  1664. warehouseDrList: [],
  1665. relevantAttachments: [],
  1666. fPlannetweight: '',
  1667. // 税率
  1668. fTaxrate: null,
  1669. // 非单个禁用
  1670. single: true,
  1671. // 非多个禁用
  1672. multiple: true,
  1673. // 显示搜索条件
  1674. showSearch: true,
  1675. // 总条数
  1676. total: 0,
  1677. // 仓库主(出入库)表格数据
  1678. goodsTransferList: [],
  1679. // 弹出层标题
  1680. title: '',
  1681. // 是否显示弹出层
  1682. open: false,
  1683. // 货权方(客户数据)
  1684. fMblnoOptions: [],
  1685. // 货权方(客户数据)
  1686. // 客户名称
  1687. KHblnoOptions: [],
  1688. fSbuOptions: [],
  1689. // 操作员
  1690. userOptions: [],
  1691. // 操作员
  1692. goodsOptions: [],
  1693. // 库存明细入账数组
  1694. dataListSelection: [],
  1695. // 库存明细撤回入账数组
  1696. dataWithdrawList: [],
  1697. // 仓库(仓库
  1698. warehouseOptions: [],
  1699. // 仓储类型 入库时选择 产地 规格 品牌 所用,对应storage_type 字典
  1700. fStorageTypeOptions: [],
  1701. kqhouseOptions: [],
  1702. // 贸易方式(数据字典),对应t_trademodels 字典
  1703. fTrademodeidOptions: [],
  1704. // 计费单位(数据字典),下拉选择毛重或净重字典
  1705. fFeetunitOptions: [],
  1706. // 结算方式(数据字典),下拉选择字典
  1707. fStltypeOptions: [],
  1708. // 是否过磅(数据字典)默认 F ,过磅T 否者F 下拉选择字典
  1709. fIfweighOptions: [],
  1710. // 是否质押(数据字典),默认 F ,质押T 否者F 下拉选择字典
  1711. fIfpledgeOptions: [],
  1712. // 是否破损(数据字典),默认F否则T字典
  1713. fIfdamageOptions: [],
  1714. // 单据类型(数据字典)SJRK字典
  1715. fBilltypeOptions: [],
  1716. // 状态(数据字典),N 入字典
  1717. fBillstatusOptions: [],
  1718. // 费用名称
  1719. fWbuOptions: [],
  1720. // 查询参数
  1721. queryParams: {
  1722. pageNum: 1,
  1723. pageSize: 10,
  1724. fBillno: null,
  1725. createBy: null,
  1726. createTime: null,
  1727. fCustomsdeclartion: null,
  1728. fOriginalbillno: null,
  1729. fDeptid: null,
  1730. fBsdeptid: null,
  1731. fContacts: null,
  1732. fTel: null,
  1733. fCorpid: null,
  1734. fTocorpid: null,
  1735. fStltypeid: null,
  1736. fBscorpno: null,
  1737. fWarehouseid: null,
  1738. fStorekeeper: null,
  1739. fBsdate: null,
  1740. fPlanqty: null,
  1741. fPlangrossweight: null,
  1742. fPlannetweight: null,
  1743. fPlanvolumn: null,
  1744. fQty: null,
  1745. fGrossweight: null,
  1746. fNetweight: null,
  1747. fVolumn: null,
  1748. fTrademodeid: null,
  1749. fSbu: null,
  1750. fFeetunit: null,
  1751. fMblno: null,
  1752. fVslvoy: null,
  1753. fEta: null,
  1754. fCustomno: null,
  1755. fIfweigh: null,
  1756. fIfpledge: null,
  1757. fIfdamage: null,
  1758. fBankcorpid: null,
  1759. fBilltype: null,
  1760. fBillstatus: null,
  1761. fCreateby: null,
  1762. fCreatetime: null,
  1763. fGoodsid: null,
  1764. fCntrtype: null,
  1765. fCntqty: null
  1766. },
  1767. // 日期区间
  1768. orgStorageDate: null,
  1769. // 表单参数
  1770. form: {
  1771. fFeetunit:"2"
  1772. },
  1773. // 库存总账参数
  1774. whgenlegParams: {
  1775. pageNum: 1,
  1776. pageSize: 10,
  1777. fMblno: null,
  1778. fCorpid: null,
  1779. fWarehouseid: null,
  1780. fTrademodeid: null,
  1781. orgStorageDate: null
  1782. },
  1783. // 库存总账表
  1784. whgenlegList: [],
  1785. whgenlegTotal: 0,
  1786. // 弹窗库存总账数据
  1787. dialogWhgenlegList: [],
  1788. // 库存总账对话框
  1789. whgenlegVisible: false,
  1790. // 表单校验
  1791. rules: {
  1792. fBsdeptid: [{ required: true, message: ' ', trigger: 'blur' }],
  1793. fCorpid: [{ required: true, message: ' ', trigger: 'blur' }],
  1794. fBsdate: [{ required: true, message: ' ', trigger: 'blur' }],
  1795. fFeetunit: [{ required: true, message: ' ', trigger: 'blur' }],
  1796. fChargedate: [{ required: true, message: ' ', trigger: 'blur' }],
  1797. fTrademodeid: [{ required: true, message: ' ', trigger: 'blur' }],
  1798. fSbu: [{ required: true, message: ' ', trigger: 'blur' }],
  1799. fStorekeeper: {
  1800. required: true,
  1801. message: ' ',
  1802. trigger: 'blur'
  1803. },
  1804. fWarehouseid: [{ required: true, message: ' ', trigger: 'blur' }],
  1805. fbillingway: [
  1806. {
  1807. required: true,
  1808. message: ' ',
  1809. trigger: 'blur'
  1810. }
  1811. ],
  1812. fTocorpid: [
  1813. {
  1814. required: true,
  1815. message: ' ',
  1816. trigger: 'blur'
  1817. }
  1818. ]
  1819. }
  1820. }
  1821. },
  1822. created() {
  1823. this.getList()
  1824. this.getDicts('tax_rate').then((response) => {
  1825. this.fTaxrate = response.data[0].dictValue
  1826. })
  1827. this.getDicts('data_trademodes').then((response) => {
  1828. this.fTrademodeidOptions = response.data
  1829. })
  1830. this.getDicts("storage_type").then((response) => {
  1831. this.fStorageTypeOptions = response.data;
  1832. });
  1833. this.getDicts('data_stltype_type').then((response) => {
  1834. this.fStltypeOptions = response.data
  1835. })
  1836. this.getDicts('data_ifweigh_status').then((response) => {
  1837. this.fIfweighOptions = response.data
  1838. })
  1839. this.getDicts('data_ifpledge_status').then((response) => {
  1840. this.fIfpledgeOptions = response.data
  1841. })
  1842. this.getDicts('data_ifdamage_status').then((response) => {
  1843. this.fIfdamageOptions = response.data
  1844. })
  1845. this.getDicts('data_billtype_type').then((response) => {
  1846. this.fBilltypeOptions = response.data
  1847. })
  1848. this.getDicts('sys_common_status').then((response) => {
  1849. this.fBillstatusOptions = response.data
  1850. })
  1851. this.getDicts('data_unitfees').then((response) => {
  1852. this.fFeetunitOptions = response.data
  1853. })
  1854. this.register()
  1855. },
  1856. activated(){
  1857. this.Jump()
  1858. },
  1859. methods: {
  1860. // 撤销审核
  1861. backrRconciliation(){
  1862. this.form.fBillstatus = '1'
  1863. backFee(this.form.fId).then(response=>{
  1864. this.msgSuccess("撤回成功")
  1865. this.getList()
  1866. this.open = false
  1867. this.getList()
  1868. })
  1869. },
  1870. // 默认录入人
  1871. register() {
  1872. queryUserVal().then((response)=>{
  1873. this.Lander = response.user.userName
  1874. })
  1875. },
  1876. // 审批按钮
  1877. goApproval(){
  1878. this.addOrUpdateVisib = true
  1879. this.$nextTick(() => {
  1880. this.$refs.ApprovalComments.init(this.form.fId,this.goodsTransferId)
  1881. })
  1882. },
  1883. Jump(){
  1884. this.approval = this.$route.query.data
  1885. if(this.approval){
  1886. this.reset()
  1887. this.colseButton = false
  1888. this.approval = JSON.parse(this.approval)
  1889. this.hide = false
  1890. this.open = true
  1891. this.browseStatus = true
  1892. this.notChange = true
  1893. this.approve = true
  1894. this.disappear = true
  1895. this.cancelButton = false
  1896. getGoodsTransfer(this.approval.billId).then((response) => {
  1897. if (response.data.warehousebills) {
  1898. this.form = response.data.warehousebills;
  1899. if (this.form.fBillstatus > 2) {
  1900. this.approvalStatus = false;
  1901. } else {
  1902. this.approvalStatus = true;
  1903. }
  1904. }
  1905. this.form = response.data.warehousebills
  1906. this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
  1907. this.$set(this.form, 'fFeetunit', Number(this.form.fFeetunit))
  1908. this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))
  1909. this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
  1910. this.fMblnoOptions = response.data.corps
  1911. this.KHblnoOptions = response.data.corps
  1912. this.fWbuOptions = response.data.feesList
  1913. this.warehouseOptions = response.data.warehouse
  1914. this.dataList = response.data.warehouseBillsItem
  1915. for (let list in this.dataList) {
  1916. if (this.dataList[list].fBillstatus && this.dataList[list].fBillstatus === 6) {
  1917. this.formBrowseStatus = true
  1918. }
  1919. this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
  1920. }
  1921. this.goodsOptions = response.data.goodsList
  1922. if (response.data.warehousebillsfeesDr) {
  1923. this.warehouseDrList = response.data.warehousebillsfeesDr
  1924. }
  1925. if (response.data.warehousebillsfeesCr) {
  1926. this.warehouseCrList = response.data.warehousebillsfeesCr
  1927. }
  1928. if (response.data.enclosures) {
  1929. this.relevantAttachments = response.data.enclosures;
  1930. }
  1931. this.userOptions = response.data.sysUser
  1932. this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
  1933. this.open = true
  1934. this.title = '修改货存转移'
  1935. })
  1936. }
  1937. },
  1938. homepaGe(){
  1939. let view = {
  1940. fullPath: "/business/goodsTransfer",
  1941. hash: "",
  1942. matched: Array(2),
  1943. meta: Object,
  1944. name: "GoodsTransfer",
  1945. params: Object,
  1946. path: "/business/goodsTransfer",
  1947. query: Object,
  1948. title: "货转"
  1949. }
  1950. this.$router.push({ path: '/index'})
  1951. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  1952. if (this.isActive(view)) {
  1953. this.toLastView(visitedViews, view)
  1954. }
  1955. })
  1956. Global.$emit("removeCache", "closeSelectedTag", view);
  1957. },
  1958. homePage() {
  1959. this.open = false
  1960. let view = {
  1961. fullPath: "/business/goodsTransfer",
  1962. hash: "",
  1963. matched: Array(2),
  1964. meta: Object,
  1965. name: "GoodsTransfer",
  1966. params: Object,
  1967. path: "/business/goodsTransfer",
  1968. query: Object,
  1969. title: "货转"
  1970. }
  1971. this.$router.push({ path: '/index' })
  1972. this.$store.dispatch('tagsView/delView', view).then(({ visitedViews }) => {
  1973. if (this.isActive(view)) {
  1974. this.toLastView(visitedViews, view)
  1975. }
  1976. })
  1977. Global.$emit("removeCache", "closeSelectedTag", view);
  1978. },
  1979. // 撤销审批
  1980. backApproval(){
  1981. let data = {
  1982. id:this.form.fId,
  1983. actId:this.goodsTransferId,
  1984. billId:this.form.fId
  1985. }
  1986. RevocationApproval(data).then(response => {
  1987. this.msgSuccess("撤销审批成功")
  1988. this.disappear = true
  1989. this.open = false
  1990. this.getList()
  1991. })
  1992. },
  1993. returnData(){
  1994. this.addOrUpdateVisib = false
  1995. this.open = false
  1996. this.homepaGe()
  1997. },
  1998. getDataList(){
  1999. this.addOrUpdateVisible = false
  2000. },
  2001. // 查看审批流
  2002. addOrUpdateHandle(){
  2003. this.addOrUpdateVisible = true
  2004. this.addOrUpdateVisib = false
  2005. let id = '448'
  2006. let actId = '110'
  2007. this.$nextTick(() => {
  2008. this.$refs.addOrUpdate.init(this.form.fId,this.goodsTransferId)
  2009. })
  2010. },
  2011. // 上传成功返回数据
  2012. showFile(row) {
  2013. // this.$set(this.relevantAttachments[0], 'fName', row.fileName)
  2014. this.$set(this.relevantAttachments[0], 'fUrl', row.url)
  2015. },
  2016. printSomething() {
  2017. // 此处的style即为打印时的样式
  2018. const style =
  2019. '@media print { .print-div{ padding:8px;background-color:#cccccc;line-height:12px } .red{ color:#f00} .green{color:green} td{text-align: center}}'
  2020. print({
  2021. printable: 'print_area',
  2022. type: 'html',
  2023. style: style, // 亦可使用引入的外部css;
  2024. scanStyles: false
  2025. })
  2026. },
  2027. // 新增附件上传
  2028. addRelevt() {
  2029. this.relevantAttachments.push({
  2030. fUrl: null,
  2031. fName: null,
  2032. createBy: this.form.createBy,
  2033. createTime: Date.parse(new Date())
  2034. })
  2035. },
  2036. // 添加list
  2037. addRelevant() {
  2038. if (!this.form.fCorpid || !this.form.fTrademodeid || !this.form.fWarehouseid) {
  2039. this.$message({ message: '请维护货权方、贸易方式、仓库', type: 'warning' })
  2040. return false
  2041. }
  2042. this.whgenlegList = []
  2043. this.dialogWhgenlegList = []
  2044. this.whgenlegTotal = 0
  2045. this.whgenlegVisible = true
  2046. this.getWhgenlegList()
  2047. },
  2048. // 查询库存总账信息
  2049. getWhgenlegList() {
  2050. this.whgenlegParams.fMblno = this.form.fMblno
  2051. this.whgenlegParams.fCorpid = this.form.fCorpid
  2052. this.whgenlegParams.fWarehouseid = this.form.fWarehouseid
  2053. this.whgenlegParams.fTrademodeid = this.form.fTrademodeid
  2054. this.whgenlegParams.orgStorageDate = this.orgStorageDate
  2055. listWhgenleg(this.whgenlegParams).then((response) => {
  2056. this.whgenlegList = response.rows
  2057. this.whgenlegTotal = response.total
  2058. })
  2059. },
  2060. // 库存总账多选框
  2061. whgenlegSelectionChange(selection) {
  2062. this.dialogWhgenlegList = selection
  2063. },
  2064. // 库存总账导出数据
  2065. whgenlegData() {
  2066. if (this.dialogWhgenlegList.length === 0) {
  2067. this.$message({ message: '未勾选信息', type: 'warning' })
  2068. return false
  2069. }
  2070. setTimeout(() => {
  2071. for (let whgen in this.dialogWhgenlegList) {
  2072. this.dataList.push({
  2073. fId: null,
  2074. fQty: 0,
  2075. fCntqty: 1,
  2076. remark: null,
  2077. fGoodsval: 0,
  2078. fNetweight: 0,
  2079. fBillstatus: 1,
  2080. fGrossweight: 0,
  2081. fMblno: this.dialogWhgenlegList[whgen].fMblno,
  2082. fMarks: this.dialogWhgenlegList[whgen].fMarks,
  2083. fPlanqty: this.dialogWhgenlegList[whgen].fQtyblc,
  2084. fGoodsid: this.dialogWhgenlegList[whgen].fGoodsid,
  2085. fVolumn: this.dialogWhgenlegList[whgen].fVolumnblc,
  2086. fGoodsids: this.dialogWhgenlegList[whgen].fGoodsids,
  2087. fBillingway: this.dialogWhgenlegList[whgen].fBillingway,
  2088. fWarehouseids: this.dialogWhgenlegList[whgen].fWarehouseids,
  2089. fPackagespecs: this.dialogWhgenlegList[whgen].fPackagespecs,
  2090. fPlannetweight: this.dialogWhgenlegList[whgen].fNetweightblc,
  2091. fOriginalbillno: this.dialogWhgenlegList[whgen].fOriginalbillno,
  2092. fPlangrossweight: this.dialogWhgenlegList[whgen].fGrossweightblc,
  2093. fBusinessType: this.dialogWhgenlegList[whgen].fBusinessType + '',
  2094. fOriginalbilldate: this.dialogWhgenlegList[whgen].fOriginalbilldate,
  2095. fWarehouselocid: this.dialogWhgenlegList[whgen].fWarehouseLocationid,
  2096. fWarehouselocids: this.dialogWhgenlegList[whgen].fWarehouseLocationids
  2097. })
  2098. }
  2099. }, 100)
  2100. setTimeout(() => {
  2101. this.updateDeduplication()
  2102. }, 300)
  2103. this.whgenlegVisible = false
  2104. },
  2105. // 更新主表品牌、品名并去重
  2106. updateDeduplication: function() {
  2107. if (this.dataList.length === 0) {
  2108. return false
  2109. }
  2110. let fMarks = []
  2111. let fProductName = []
  2112. let fMblno = []
  2113. for (let li in this.dataList) {
  2114. fMarks.push(this.dataList[li].fMarks)
  2115. fProductName.push(this.dataList[li].fGoodsids)
  2116. fMblno.push(this.dataList[li].fMblno)
  2117. }
  2118. this.$set(this.form, 'fMarks', Array.from(new Set(fMarks)).join(","))
  2119. this.$set(this.form, 'fProductName', Array.from(new Set(fProductName)).join(","))
  2120. this.$set(this.form, 'fMblno', Array.from(new Set(fMblno)).join(","))
  2121. },
  2122. // 收货单打印界面
  2123. showEditDialog_s() {
  2124. this.editDialogVisible_s = true
  2125. },
  2126. showEditDialog_ss() {
  2127. this.editDialogVisible_ss = true
  2128. },
  2129. // 收款信息
  2130. addCollection() {
  2131. this.warehouseDrList.push({
  2132. fCorpid: null,
  2133. fFeeid: null,
  2134. fFeeunitid: 1,
  2135. fQty: 0,
  2136. fUnitprice: 0,
  2137. fAmount: 0,
  2138. fCurrency: null,
  2139. fCxrate: null,
  2140. fTaxrate: this.fTaxrate,
  2141. fRate: null,
  2142. remarks: null,
  2143. fMblno:this.form.fMblno,
  2144. fProductName:this.form.fProductName,
  2145. fMarks:this.form.fMarks
  2146. })
  2147. },
  2148. addpayment() {
  2149. this.warehouseCrList.push({
  2150. fCorpid: null,
  2151. fFeeid: null,
  2152. fFeeunitid: 1,
  2153. fQty: 0,
  2154. fUnitprice: 0,
  2155. fAmount: 0,
  2156. fCurrency: null,
  2157. fTaxrate: this.fTaxrate,
  2158. fCxrate: null,
  2159. fRate: null,
  2160. remarks: null,
  2161. fMblno:this.form.fMblno,
  2162. fProductName:this.form.fProductName,
  2163. fMarks:this.form.fMarks
  2164. })
  2165. },
  2166. queryUser() {
  2167. queryUserVal().then((response) => {
  2168. if (response.user !== null) {
  2169. this.userVal = response.user
  2170. this.$set(this.form, 'fDeptid', this.userVal.deptId)
  2171. this.$set(this.form, 'createBy', this.userVal.userName)
  2172. this.$set(this.form,"fStorekeeper",this.userVal.userName)
  2173. this.$set(this.form, 'fTrademodeid', '1')
  2174. // this.$set(this.relevantAttachments, "opUserName", this.userVal.userName);
  2175. this.$set(this.form, 'createTime', Date.parse(new Date()))
  2176. }
  2177. })
  2178. },
  2179. /** 查询仓库主(出入库)列表 */
  2180. getList() {
  2181. this.loading = true
  2182. listGoodsTransfer(this.queryParams).then((response) => {
  2183. this.goodsTransferList = response.rows
  2184. this.total = response.total
  2185. this.loading = false
  2186. })
  2187. },
  2188. /* 远程模糊查询库区 */
  2189. kqhouseRemoteMethod(name) {
  2190. if (name == null || name === '') {
  2191. return false
  2192. }
  2193. if (!this.form.fWarehouseid) {
  2194. this.$message.error('请输入仓库!')
  2195. return false
  2196. }
  2197. let queryParams = {
  2198. pageNum: 1,
  2199. pageSize: 10,
  2200. fWarehouseid: this.form.fWarehouseid,
  2201. fName: name
  2202. }
  2203. listArea(queryParams).then((response) => {
  2204. this.kqhouseOptions = response.rows
  2205. })
  2206. },
  2207. // 贸易方式(数据字典),对���t_trademodels 字典翻译
  2208. fTrademodeidFormat(row, column) {
  2209. return this.selectDictLabel(this.fTrademodeidOptions, row.fTrademodeid)
  2210. },
  2211. // 是否过磅(数据字典)默认 F ,过磅T 否者F 下拉选择字典翻译
  2212. fIfweighFormat(row, column) {
  2213. return this.selectDictLabel(this.fIfweighOptions, row.fIfweigh)
  2214. },
  2215. // 编号字典翻译
  2216. fStltypeidFormat(row, column) {
  2217. return this.selectDictLabel(this.fStltypeOptions, row.fStltypeid)
  2218. },
  2219. // 是否质押(数据字典),默认 F ,质押T 否者F 下拉选择字典翻译
  2220. fIfpledgeFormat(row, column) {
  2221. return this.selectDictLabel(this.fIfpledgeOptions, row.fIfpledge)
  2222. },
  2223. // 是否破损(数据字典),默认F否则T字典翻译
  2224. fIfdamageFormat(row, column) {
  2225. return this.selectDictLabel(this.fIfdamageOptions, row.fIfdamage)
  2226. },
  2227. // 单据类型(数据字典)SJRK字典翻译
  2228. fBilltypeFormat(row, column) {
  2229. return this.selectDictLabel(this.fBilltypeOptions, row.fBilltype)
  2230. },
  2231. // 状态(数据字典),N 入字典翻译
  2232. fBillstatusFormat(row, column) {
  2233. return this.selectDictLabel(this.fBillstatusOptions, row.fBillstatus)
  2234. },
  2235. // 取消按钮
  2236. cancel() {
  2237. this.reset()
  2238. this.open = false
  2239. this.getList()
  2240. },
  2241. // 表单重置
  2242. reset() {
  2243. this.disappear = false
  2244. this.addOrUpdateVisible = false
  2245. this.addOrUpdateVisib = false
  2246. this.approve = false
  2247. this.formBrowseStatus = false
  2248. this.detailsHidden = false
  2249. this.notChange = false
  2250. this.browseStatus = false
  2251. this.whgenlegVisible = false
  2252. this.editDialogVisible_ss = false
  2253. this.editDialogVisible_s = false
  2254. this.dataList = []
  2255. this.fWbuOptions = []
  2256. this.fWbuOptions = []
  2257. this.resetForm('form')
  2258. this.fMblnoOptions = []
  2259. this.KHblnoOptions = []
  2260. this.KHblnoOptions = []
  2261. this.warehouseDrList = []
  2262. this.warehouseCrList = []
  2263. this.warehouseOptions = []
  2264. this.relevantAttachments = []
  2265. },
  2266. /** 搜索按钮操作 */
  2267. handleQuery() {
  2268. this.queryParams.pageNum = 1
  2269. this.getList()
  2270. },
  2271. /** 重置按钮操作 */
  2272. resetQuery() {
  2273. this.resetForm('queryForm')
  2274. this.handleQuery()
  2275. },
  2276. // 多选框选中数据
  2277. handleSelectionChange(selection) {
  2278. this.ids = selection.map((item) => item.fId)
  2279. this.single = selection.length !== 1
  2280. this.multiple = !selection.length
  2281. },
  2282. /** 新增按钮操作 */
  2283. handleAdd() {
  2284. this.reset()
  2285. this.notChange = false
  2286. this.browseStatus = false
  2287. this.queryUser()
  2288. this.open = true
  2289. this.dataList = []
  2290. this.warehouseCrList = []
  2291. this.warehouseDrList = []
  2292. this.relevantAttachments = []
  2293. this.title = '货权转移'
  2294. },
  2295. check_s(row) {
  2296. this.disappear = true
  2297. this.notChange = true
  2298. this.browseStatus = true
  2299. const fId = row.fId || this.ids
  2300. getGoodsTransfer(fId).then((response) => {
  2301. this.Operator = response.data.corps[0].createBy
  2302. this.form = response.data.warehousebills
  2303. this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
  2304. this.$set(this.form, 'fFeetunit', Number(this.form.fFeetunit))
  2305. this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))
  2306. this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
  2307. this.fMblnoOptions = response.data.corps
  2308. this.KHblnoOptions = response.data.corps
  2309. this.fWbuOptions = response.data.feesList
  2310. this.warehouseOptions = response.data.warehouse
  2311. this.dataList = response.data.warehouseBillsItem
  2312. for (let list in this.dataList) {
  2313. if (this.dataList[list].fBillstatus && this.dataList[list].fBillstatus === 6) {
  2314. this.formBrowseStatus = true
  2315. }
  2316. this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
  2317. }
  2318. this.goodsOptions = response.data.goodsList
  2319. if (response.data.warehousebillsfeesDr) {
  2320. this.warehouseDrList = response.data.warehousebillsfeesDr
  2321. }
  2322. if (response.data.warehousebillsfeesCr) {
  2323. this.warehouseCrList = response.data.warehousebillsfeesCr
  2324. }
  2325. if (response.data.enclosures) {
  2326. this.relevantAttachments = response.data.enclosures;
  2327. }
  2328. this.userOptions = response.data.sysUser
  2329. this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
  2330. this.open = true
  2331. this.title = '修改货存转移'
  2332. console.log(this.Operator)
  2333. console.log(this.Lander)
  2334. })
  2335. },
  2336. // 查看按钮
  2337. check(row) {
  2338. this.disappear = false
  2339. this.notChange = true
  2340. this.browseStatus = true
  2341. const fId = row.fId || this.ids
  2342. getGoodsTransfer(fId).then((response) => {
  2343. console.log(response.data.corps[0].createBy)
  2344. this.Operator = response.data.corps[0].createBy
  2345. this.form = response.data.warehousebills
  2346. this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
  2347. this.$set(this.form, 'fFeetunit', Number(this.form.fFeetunit))
  2348. this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))
  2349. this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
  2350. this.fMblnoOptions = response.data.corps
  2351. this.KHblnoOptions = response.data.corps
  2352. this.fWbuOptions = response.data.feesList
  2353. this.warehouseOptions = response.data.warehouse
  2354. this.dataList = response.data.warehouseBillsItem
  2355. for (let list in this.dataList) {
  2356. if (this.dataList[list].fBillstatus && this.dataList[list].fBillstatus === 6) {
  2357. this.formBrowseStatus = true
  2358. }
  2359. this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
  2360. }
  2361. this.goodsOptions = response.data.goodsList
  2362. if (response.data.warehousebillsfeesDr) {
  2363. this.warehouseDrList = response.data.warehousebillsfeesDr
  2364. }
  2365. if (response.data.warehousebillsfeesCr) {
  2366. this.warehouseCrList = response.data.warehousebillsfeesCr
  2367. }
  2368. if (response.data.enclosures) {
  2369. this.relevantAttachments = response.data.enclosures;
  2370. }
  2371. this.userOptions = response.data.sysUser
  2372. this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
  2373. this.open = true
  2374. this.title = '修改货存转移'
  2375. console.log(this.Operator)
  2376. console.log(this.Lander)
  2377. })
  2378. },
  2379. /** 修改按钮操作 */
  2380. handleUpdate(row, status) {
  2381. this.reset()
  2382. this.notChange = false
  2383. this.browseStatus = status
  2384. const fId = row.fId || this.ids
  2385. getGoodsTransfer(fId).then((response) => {
  2386. this.form = response.data.warehousebills
  2387. this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
  2388. this.$set(this.form, 'fFeetunit', this.form.fFeetunit + '')
  2389. this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
  2390. this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))
  2391. this.fMblnoOptions = response.data.corps
  2392. this.KHblnoOptions = response.data.corps
  2393. this.fWbuOptions = response.data.feesList
  2394. this.warehouseOptions = response.data.warehouse
  2395. this.dataList = response.data.warehouseBillsItem
  2396. for (let list in this.dataList) {
  2397. if (this.dataList[list].fBillstatus && this.dataList[list].fBillstatus === 6) {
  2398. this.formBrowseStatus = true
  2399. }
  2400. this.$set(this.dataList[list], 'fBsdate', Date.parse(this.dataList[list].fBsdate))
  2401. this.$set(this.dataList[list], 'fBusinessType', this.dataList[list].fBusinessType + '')
  2402. }
  2403. this.goodsOptions = response.data.goodsList
  2404. if (response.data.warehousebillsfeesDr) {
  2405. this.warehouseDrList = response.data.warehousebillsfeesDr
  2406. }
  2407. if (response.data.warehousebillsfeesCr) {
  2408. this.warehouseCrList = response.data.warehousebillsfeesCr
  2409. }
  2410. if (response.data.enclosures) {
  2411. this.relevantAttachments = response.data.enclosures;
  2412. }
  2413. this.userOptions = response.data.sysUser
  2414. this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
  2415. this.open = true
  2416. this.title = '修改货存转移'
  2417. })
  2418. },
  2419. // 库存明细合计
  2420. getSummaries(param) {
  2421. const { columns, data } = param
  2422. const sums = []
  2423. var values = []
  2424. columns.forEach((column, index) => {
  2425. if (index === 0) {
  2426. sums[index] = ''
  2427. return
  2428. }
  2429. if (column.property === 'fPlanqty') {
  2430. values = data.map((item) => Number(item['fPlanqty']))
  2431. }
  2432. if (column.property === 'fNetweight') {
  2433. values = data.map((item) => Number(item['fPlannetweight']))
  2434. }
  2435. if (column.property === 'fPlannetweight') {
  2436. values = data.map((item) => Number(item['fPlannetweight']))
  2437. }
  2438. if (column.property === 'fQty') {
  2439. values = data.map((item) => Number(item['fQty']))
  2440. }
  2441. if (column.property === 'fGrossweight') {
  2442. values = data.map((item) => Number(item['fGrossweight']))
  2443. }
  2444. if (column.property === 'fCntqty') {
  2445. values = data.map((item) => Number(item['fCntqty']))
  2446. } // const values = data.map(item => Number(item[column.property]))
  2447. if (
  2448. column.property === 'fPlanqty' ||
  2449. column.property === 'fPlannetweight' ||
  2450. column.property === 'fQty' ||
  2451. column.property === 'fGrossweight' ||
  2452. column.property === 'fCntqty' ||
  2453. column.property === 'fPlannetweight'
  2454. ) {
  2455. sums[index] = values.reduce((prev, curr) => {
  2456. const value = Number(curr)
  2457. if (!isNaN(value)) {
  2458. if (column.property === 'fGrossweight') {
  2459. this.form.fGrossweight = prev + curr
  2460. }
  2461. if (column.property === 'fQty') {
  2462. this.form.fQty = prev + curr
  2463. }
  2464. if (column.property === 'fCntqty') {
  2465. this.form.fCntqty = prev + curr
  2466. }
  2467. if (column.property === 'fPlannetweight') {
  2468. this.form.fNetweight = prev + curr
  2469. }
  2470. return prev + curr
  2471. } else {
  2472. return prev
  2473. }
  2474. }, 0) // sums[index]
  2475. }
  2476. })
  2477. this.sums = sums
  2478. return sums
  2479. },
  2480. // 入账
  2481. creditClick() {
  2482. if (this.dataList.length === 0) {
  2483. this.$message({ message: '未找到货转明细', type: 'warning' })
  2484. return false
  2485. }
  2486. for (let dataSelection in this.dataListSelection) {
  2487. if (!this.dataListSelection[dataSelection].fId) {
  2488. this.$message({ message: '请先点击保存,在进行货转确认', type: 'warning' })
  2489. return false
  2490. }
  2491. }
  2492. this.$refs['form'].validate((valid) => {
  2493. if (valid) {
  2494. for (let li in this.dataList) {
  2495. if(this.form.fFeetunit > 3){
  2496. this.$message.error('请维护主表计费单位为件数、毛重或净重')
  2497. return false
  2498. }
  2499. if (!this.dataList[li].fWarehouselocids) {
  2500. this.$message({ message: '请维护第' + Number(li) + 1 + '行库区', type: 'warning' })
  2501. return false
  2502. }
  2503. if (!this.dataList[li].fQty) {
  2504. this.$message({ message: '请维护第' + Number(li) + 1 + '行货转件数', type: 'warning' })
  2505. return false
  2506. }
  2507. if (!this.dataList[li].fGrossweight) {
  2508. this.$message({ message: '请维护第' + Number(li) + 1 + '行货转毛重', type: 'warning' })
  2509. return false
  2510. }
  2511. if (!this.dataList[li].fNetweight) {
  2512. this.$message({ message: '请维护第' + Number(li) + 1 + '行货转净重', type: 'warning' })
  2513. return false
  2514. }
  2515. if (!this.dataList[li].fPackagespecs) {
  2516. this.$message({ message: '请维护第' + Number(li) + 1 + '行货包装规格', type: 'warning' })
  2517. return false
  2518. }
  2519. }
  2520. let formData = new window.FormData()
  2521. formData.append("warehouseBills", JSON.stringify(this.form));
  2522. formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
  2523. formData.append("warehousebillsitems", JSON.stringify(this.dataListSelection));
  2524. formData.append("warehousebillsfeesCr", JSON.stringify(this.warehouseCrList));
  2525. formData.append("warehousebillsfeesDr", JSON.stringify(this.warehouseDrList));
  2526. addWhgenleg(formData).then((response) => {
  2527. this.$refs.tableListRef.clearSelection()
  2528. this.msgSuccess('入账成功')
  2529. let item = response.data.warehouseItem
  2530. for (let li in this.dataList) {
  2531. for (let ite in item) {
  2532. if (this.dataList[li].fId === item[ite].fId) {
  2533. this.$set(this.dataList[li], 'fBillstatus', 6)
  2534. }
  2535. }
  2536. }
  2537. this.formBrowseStatus = true
  2538. })
  2539. }
  2540. })
  2541. },
  2542. // 撤回货转
  2543. withdrawClick() {
  2544. // 撤回货转
  2545. let formData = new window.FormData()
  2546. let withdrawList = JSON.parse(JSON.stringify(this.dataWithdrawList))
  2547. formData.append("warehouseBills", JSON.stringify(this.form));
  2548. formData.append("warehousebillsitems", JSON.stringify(withdrawList));
  2549. formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
  2550. formData.append("warehousebillsfeesCr", JSON.stringify(this.warehouseCrList));
  2551. formData.append("warehousebillsfeesDr", JSON.stringify(this.warehouseDrList));
  2552. updateCredit(formData).then((response) => {
  2553. this.fid = response.data
  2554. this.formBrowseStatus = false
  2555. this.msgSuccess('撤销入账成功')
  2556. this.$refs.tableListRef.clearSelection()
  2557. let mun = 0;
  2558. for (let i in this.dataList) {
  2559. for (let li in withdrawList) {
  2560. if (withdrawList[li].fId === this.dataList[i].fId) {
  2561. this.$set(this.dataList[i], 'fBillstatus', 1)
  2562. }
  2563. }
  2564. if (this.dataList[i].fBillstatus && this.dataList[i].fBillstatus === 6) {
  2565. mun ++;
  2566. }
  2567. }
  2568. if (mun > 0) {
  2569. this.formBrowseStatus = true
  2570. } else {
  2571. this.formBrowseStatus = false
  2572. }
  2573. })
  2574. },
  2575. // 付款合计
  2576. warehouseDrSummaries(param) {
  2577. const { columns, data } = param
  2578. const sums = []
  2579. columns.forEach((column, index) => {
  2580. if (index === 0) {
  2581. sums[index] = '合计'
  2582. return
  2583. }
  2584. const values = data.map((item) => Number(item[column.property]))
  2585. if (
  2586. column.property === 'fUnitprice' ||
  2587. column.property === 'fAmount' ||
  2588. column.property === 'fQty' ||
  2589. column.property === 'fQty'
  2590. ) {
  2591. sums[index] = values.reduce((prev, curr) => {
  2592. const value = Number(curr)
  2593. if (!isNaN(value)) {
  2594. return prev + curr
  2595. } else {
  2596. return prev
  2597. }
  2598. }, 0) // sums[index]
  2599. sums[index] = sums[index].toFixed(2);
  2600. }
  2601. })
  2602. return sums
  2603. },
  2604. // 数量计算
  2605. changeContractAmt(row) {
  2606. let fQty = 0
  2607. let fUnitprice = 0
  2608. if (row.fUnitprice) {
  2609. fUnitprice = row.fUnitprice
  2610. }
  2611. if (row.fQty) {
  2612. fQty = row.fQty
  2613. }
  2614. this.$set(row, 'fAmount', Number(fUnitprice) * Number(fQty)).toFixed(2)
  2615. },
  2616. changefBsdate(row) {
  2617. if (this.dataList.length > 0) {
  2618. for (var i = 0; i < this.dataList.length; i++) {
  2619. this.$set(this.dataList[i], 'fBsdate', row)
  2620. }
  2621. }
  2622. },
  2623. // 库存明细多选
  2624. Selectinventory(selection) {
  2625. this.dataWithdrawList = []
  2626. this.dataListSelection = []
  2627. if (!selection || selection.length === 0) {
  2628. return false
  2629. }
  2630. for (let se in selection) {
  2631. if (!selection[se].fBillstatus || selection[se].fBillstatus !== 6) {
  2632. this.dataListSelection.push(selection[se])
  2633. } else if (selection[se].fBillstatus && selection[se].fBillstatus === 6) {
  2634. this.dataWithdrawList.push(selection[se])
  2635. }
  2636. }
  2637. },
  2638. // 库存明细多选框结果
  2639. dataListChange(row) {
  2640. this.dataListSelection = row
  2641. },
  2642. saveForm() {
  2643. this.updateDeduplication()
  2644. this.$refs['form'].validate((valid) => {
  2645. if (this.form.fCorpid === this.form.fTocorpid) {
  2646. this.$message.error('新货权方不得与货权方一致')
  2647. return false
  2648. }
  2649. if (this.dataList.length === 0) {
  2650. this.$message.error('请添加库存明细!')
  2651. return false
  2652. }
  2653. this.updateDeduplication()
  2654. for (let list in this.dataList) {
  2655. if (!this.dataList[list].fQty || Number(this.dataList[list].fQty) === 0) {
  2656. this.$message.error('请维护序号为' + (Number(list) + 1) + '的货转件数!')
  2657. return false
  2658. }
  2659. if (!this.dataList[list].fGrossweight || Number(this.dataList[list].fGrossweight) === 0) {
  2660. this.$message.error('请维护序号为' + (Number(list) + 1) + '的货转毛重!')
  2661. return false
  2662. }
  2663. }
  2664. if (valid) {
  2665. this.form.fBillstatus = 2
  2666. let formData = new window.FormData()
  2667. formData.append("warehouseBills", JSON.stringify(this.form));
  2668. formData.append("warehousebillsitems", JSON.stringify(this.dataList));
  2669. formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
  2670. formData.append("warehousebillsfeesCr", JSON.stringify(this.warehouseCrList));
  2671. formData.append("warehousebillsfeesDr", JSON.stringify(this.warehouseDrList));
  2672. addGoodsTransfer(formData).then((response) => {
  2673. this.msgSuccess('保存成功')
  2674. this.form = response.data.warehouseBills
  2675. this.$set(this.form, 'fBsdate', Date.parse(this.form.fBsdate))
  2676. this.$set(this.form, 'fFeetunit',this.form.fFeetunit + '')
  2677. this.$set(this.form, 'fStltypeid', this.form.fStltypeid + '')
  2678. this.$set(this.form, 'fTrademodeid', this.form.fTrademodeid + '')
  2679. this.$set(this.form, 'fChargedate', Date.parse(this.form.fChargedate))
  2680. this.dataList = response.data.warehousebillsitems
  2681. for (let li in this.dataList) {
  2682. this.$set(this.dataList[li], 'fBusinessType', this.dataList[li].fBusinessType + '')
  2683. }
  2684. })
  2685. }
  2686. })
  2687. },
  2688. /** 提交按钮 */
  2689. submitForm() {
  2690. this.$refs['form'].validate((valid) => {
  2691. if (this.form.fCorpid === this.form.fTocorpid) {
  2692. this.$message.error('新货权方不得与货权方一致')
  2693. return false
  2694. }
  2695. if (this.dataList.length === 0) {
  2696. this.$message.error('请添加库存明细!')
  2697. return false
  2698. }
  2699. for (let list in this.dataList) {
  2700. if (!this.dataList[list].fQty || Number(this.dataList[list].fQty) === 0) {
  2701. this.$message.error('请维护序号为' + (Number(list) + 1) + '的货转件数!')
  2702. return false
  2703. }
  2704. if (!this.dataList[list].fGrossweight || Number(this.dataList[list].fGrossweight) === 0) {
  2705. this.$message.error('请维护序号为' + (Number(list) + 1) + '的货转毛重!')
  2706. return false
  2707. }
  2708. }
  2709. if (this.relevantAttachments.length !== 0) {
  2710. for (let relevant in this.relevantAttachments) {
  2711. if (!this.relevantAttachments[relevant].fName) {
  2712. this.$message.error('请输入附件名称!')
  2713. return false
  2714. }
  2715. }
  2716. }
  2717. if (this.warehouseDrList.length !== 0) {
  2718. for (let warehouseDr in this.warehouseDrList) {
  2719. if (!this.warehouseDrList[warehouseDr].fAmount) {
  2720. this.$message.error('收款信息序号为' + (Number(warehouseDr) + 1) + '的金额异常')
  2721. return false
  2722. }
  2723. }
  2724. }
  2725. if (this.warehouseDrList.length !== 0) {
  2726. for (let warehouseCr in this.warehouseCrList) {
  2727. if (!this.warehouseCrList[warehouseCr].fAmount) {
  2728. this.$message.error(
  2729. '付款信息序号为' + (Number(warehouseCr) + 1) + '的金额异常'
  2730. )
  2731. return false
  2732. }
  2733. }
  2734. }
  2735. if (valid) {
  2736. // this.form.fBillstatus = 4
  2737. let formData = new window.FormData()
  2738. formData.append("warehouseBills", JSON.stringify(this.form));
  2739. formData.append("warehousebillsitems", JSON.stringify(this.dataList));
  2740. formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
  2741. formData.append("warehousebillsfeesCr", JSON.stringify(this.warehouseCrList));
  2742. formData.append("warehousebillsfeesDr", JSON.stringify(this.warehouseDrList));
  2743. warehouseSubmission(formData).then((response) => {
  2744. this.msgSuccess('提交成功')
  2745. // this.browseStatus = true
  2746. // this.notChange = true
  2747. this.cancel()
  2748. this.getList()
  2749. })
  2750. }
  2751. })
  2752. },
  2753. /** 删除按钮操作 */
  2754. handleDelete(row) {
  2755. const fIds = row.fId || this.ids
  2756. this.$confirm(
  2757. '是否确认删除仓库主(出入库)编号为"' + fIds + '"的数据项?',
  2758. '警告',
  2759. {
  2760. confirmButtonText: '确定',
  2761. cancelButtonText: '取消',
  2762. type: 'warning'
  2763. }
  2764. )
  2765. .then(function() {
  2766. return delGoodsTransfer(fIds)
  2767. })
  2768. .then(() => {
  2769. this.getList()
  2770. this.msgSuccess('删除成功')
  2771. })
  2772. },
  2773. /** 导出按钮操作 */
  2774. handleExport() {
  2775. const queryParams = this.queryParams
  2776. this.$confirm('是否确认导出所有仓库主(出入库)数据项?', '警告', {
  2777. confirmButtonText: '确定',
  2778. cancelButtonText: '取消',
  2779. type: 'warning'
  2780. })
  2781. .then(function() {
  2782. return exportgoodsTransfer(queryParams)
  2783. })
  2784. .then((response) => {
  2785. this.download(response.msg)
  2786. })
  2787. },
  2788. // 货转件数的计算
  2789. qtyChange(row) {
  2790. if (!row.fQty || row.fQty === '') {
  2791. this.$set(row, 'fNetweight', 0)
  2792. this.$set(row, 'fGrossweight', 0)
  2793. return false
  2794. }
  2795. if (row.fPlanqty < row.fQty) {
  2796. this.$message.error("货转件数超出结余件数!");
  2797. this.$set(row, 'fQty', 0)
  2798. this.$set(row, 'fNetweight', 0)
  2799. this.$set(row, 'fGrossweight', 0)
  2800. return false;
  2801. }
  2802. let netweight = parseFloat(Number(row.fPlannetweight) / Number(row.fPlanqty)).toFixed(2)
  2803. let grossweigh = parseFloat(Number(row.fPlangrossweight) / Number(row.fPlanqty)).toFixed(2)
  2804. this.$set(row, 'fNetweight', parseFloat(Number(netweight) * Number(row.fQty)).toFixed(2))
  2805. this.$set(row, 'fGrossweight', parseFloat(Number(grossweigh) * Number(row.fQty)).toFixed(2))
  2806. },
  2807. // 修改毛重净重
  2808. changeTransfer (row) {
  2809. let fNetweight = 0;
  2810. let fGrossweight = 0;
  2811. if (row.fNetweight) {
  2812. fNetweight = row.fNetweight
  2813. }
  2814. if (row.fGrossweight) {
  2815. fGrossweight = row.fGrossweight
  2816. }
  2817. if (row.fPlannetweight < fNetweight) {
  2818. this.$message({ message: '货转净重超出结余净重', type: 'warning' })
  2819. return false
  2820. }
  2821. if (row.fPlangrossweight < fGrossweight) {
  2822. this.$message({ message: '货转毛重超出结余毛重', type: 'warning' })
  2823. return false
  2824. }
  2825. },
  2826. deleteRow(index, rows) {
  2827. rows.splice(index, 1)
  2828. this.this.updateDeduplication()
  2829. },
  2830. // 变更计价单位
  2831. changeFeeUnit(row) {
  2832. if (!row.fFeeunitid) {
  2833. return false
  2834. }
  2835. let fQty = 0;
  2836. let fGrossweight = 0;
  2837. let fNetweight = 0;
  2838. let volumn = 0;
  2839. let fixed = 1;
  2840. for (let li in this.dataList) {
  2841. if (this.dataList[li].fQty) {
  2842. fQty = parseFloat(Number(fQty) + Number(this.dataList[li].fQty)).toFixed(2)
  2843. }
  2844. if (this.dataList[li].fGrossweight) {
  2845. fGrossweight = parseFloat(Number(fGrossweight) + Number(this.dataList[li].fGrossweight)).toFixed(2)
  2846. }
  2847. if (this.dataList[li].fNetweight) {
  2848. fNetweight = parseFloat(Number(fNetweight) + Number(this.dataList[li].fNetweight)).toFixed(2)
  2849. }
  2850. if (this.dataList[li].volumn) {
  2851. volumn = parseFloat(Number(volumn) + Number(this.dataList[li].volumn)).toFixed(2)
  2852. }
  2853. }
  2854. if (row.fFeeunitid === 1) {
  2855. this.$set(row, 'fQty', fQty)
  2856. } else if (row.fFeeunitid === 2) {
  2857. this.$set(row, 'fQty', fGrossweight)
  2858. }else if (row.fFeeunitid === 3) {
  2859. this.$set(row, 'fQty', fNetweight)
  2860. }else if (row.fFeeunitid === 4) {
  2861. this.$set(row, 'fQty', volumn)
  2862. }else if (row.fFeeunitid === 5) {
  2863. this.$set(row, 'fQty', fixed)
  2864. }
  2865. if (row.fUnitprice) {
  2866. this.$set(row, 'fAmount', parseFloat(Number(row.fUnitprice) * Number(row.fQty)).toFixed(2))
  2867. }
  2868. },
  2869. // 选择新货权方自动带出结算方式
  2870. changefCorpid(row) {
  2871. this.$set(row, "fSbu", row.fCorpid);
  2872. for (let corp in this.fMblnoOptions) {
  2873. if (row.fTocorpid === this.fMblnoOptions[corp].fId) {
  2874. this.$set(this.form, "fStltypeid", this.fMblnoOptions[corp].fStltypeid + '');
  2875. }
  2876. }
  2877. },
  2878. /* 远程模糊查询用户 */
  2879. corpsRemoteMethod(name) {
  2880. if (name == null || name === '') {
  2881. return false
  2882. }
  2883. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  2884. listCorps(queryParams).then((response) => {
  2885. this.fMblnoOptions = response.rows
  2886. this.KHblnoOptions = response.rows
  2887. })
  2888. },
  2889. /* 远程模糊查询商品 */
  2890. goodsRemoteMethod(name) {
  2891. if (name == null || name === '') {
  2892. return false
  2893. }
  2894. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  2895. listGoods(queryParams).then((response) => {
  2896. this.goodsOptions = response.rows
  2897. })
  2898. },
  2899. // 选择费用信息时获取计价单位
  2900. changeFeeId (row) {
  2901. for (let li in this.fWbuOptions) {
  2902. if (row.fFeeid === this.fWbuOptions[li].fId) {
  2903. this.$set(row, 'fFeeUnitid', this.fWbuOptions[li].fFeeunitid + '')
  2904. this.changeFeeUnit(row)
  2905. break
  2906. }
  2907. }
  2908. },
  2909. // 远程模糊查询费用名称
  2910. fWRemoteMethod(name) {
  2911. if (name == null || name === '') {
  2912. return false
  2913. }
  2914. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  2915. listFees(queryParams).then((response) => {
  2916. this.fWbuOptions = response.rows
  2917. })
  2918. },
  2919. /* 远程模糊查询经营单位 */
  2920. fSbuRemoteMethod(name) {
  2921. if (name == null || name === '') {
  2922. return false
  2923. }
  2924. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  2925. listCorps(queryParams).then((response) => {
  2926. this.fSbuOptions = response.rows
  2927. })
  2928. },
  2929. /* 远程模糊查询仓库 */
  2930. warehouseRemoteMethod(name) {
  2931. if (name == null || name === '') {
  2932. return false
  2933. }
  2934. let queryParams = { pageNum: 1, pageSize: 10, fName: name }
  2935. listWarehouse(queryParams).then((response) => {
  2936. this.warehouseOptions = response.rows
  2937. })
  2938. },
  2939. /* 远程模糊查询操作用户 */
  2940. userRemoteMethod(name) {
  2941. if (name == null || name === '') {
  2942. return false
  2943. }
  2944. let queryParams = { pageNum: 1, pageSize: 10, userName: name }
  2945. listUser(queryParams).then((response) => {
  2946. this.userOptions = response.rows
  2947. })
  2948. }
  2949. }
  2950. }
  2951. </script>
  2952. <style lang="scss">
  2953. .juzhong > th {
  2954. text-align: center;
  2955. }
  2956. .biaoge > tr > td {
  2957. height: 30px;
  2958. text-align: center;
  2959. border-right: 1px solid #dfe6ec !important;
  2960. order-bottom: 1px solid #dfe6ec !important;
  2961. border-bottom: 1px solid #dfe6ec !important;
  2962. }
  2963. .el-table thead th {
  2964. background: #1890ff;
  2965. color: #fff;
  2966. }
  2967. .upload-demo {
  2968. margin-left: 50px;
  2969. }
  2970. .el-form-item {
  2971. margin-bottom: 5px !important;
  2972. }
  2973. .el-form-item__label {
  2974. font-size: 12px !important;
  2975. }
  2976. </style>