index.vue 72 KB

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