index.vue 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324
  1. <template>
  2. <div class="app-container">
  3. <div v-show="pageShow">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. v-show="showSearch"
  8. label-width="90px"
  9. size="small"
  10. >
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="客户" prop="fCorpid">
  14. <el-select
  15. v-model="queryParams.fCorpid"
  16. clearable
  17. filterable
  18. placeholder="请输入关键词"
  19. style="width: 200px"
  20. >
  21. <el-option
  22. v-for="(item, index) in fMblnoOptions"
  23. :key="index.fId"
  24. :label="item.fName"
  25. :value="item.fId"
  26. ></el-option>
  27. </el-select>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="6">
  31. <el-form-item label="提单号" prop="fMblno">
  32. <el-input
  33. v-model="queryParams.fMblno"
  34. placeholder="请输入提单号"
  35. clearable
  36. style="width: 200px"
  37. @keyup.enter.native="handleQuery"
  38. />
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="6">
  42. <el-form-item label="入库日期" prop="timeInterval">
  43. <el-date-picker
  44. v-model="queryParams.timeInterval"
  45. type="daterange"
  46. value-format="yyyy-MM-dd HH:mm:ss"
  47. :default-time="['00:00:00', '23:59:59']"
  48. clearable
  49. style="width: 230px"
  50. range-separator="至"
  51. start-placeholder="开始日期"
  52. end-placeholder="结束日期"
  53. @keyup.enter.native="handleQuery"
  54. :picker-options="pickerOptions"
  55. unlink-panels
  56. >
  57. </el-date-picker>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :span="6">
  61. <el-form-item label="车号" prop="fWarehouseid">
  62. <el-select
  63. v-model="queryParams.fTruckno"
  64. clearable
  65. filterable
  66. placeholder="请选择车号"
  67. style="width: 200px"
  68. @keyup.enter.native="handleQuery"
  69. >
  70. <el-option
  71. v-for="(item, index) in fTrucknoList"
  72. :key="index"
  73. :label="item.fTruckno"
  74. :value="item.fTruckno"
  75. ></el-option>
  76. </el-select>
  77. </el-form-item>
  78. </el-col>
  79. </el-row>
  80. <el-collapse-transition>
  81. <div v-show="show">
  82. <el-row>
  83. <el-col :span="6">
  84. <el-form-item label="货物名称" prop="fGoodsid">
  85. <el-select
  86. v-model="queryParams.fGoodsid"
  87. clearable
  88. filterable
  89. placeholder="请选择货物名称"
  90. style="width: 200px"
  91. @keyup.enter.native="handleQuery"
  92. >
  93. <el-option
  94. v-for="(item, index) in goodsOptions"
  95. :key="index.fId"
  96. :label="item.fName"
  97. :value="item.fId"
  98. ></el-option>
  99. </el-select>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :span="6">
  103. <el-form-item label="属性详情" prop="fMarks">
  104. <el-input
  105. v-model="queryParams.fMarks"
  106. placeholder="请输入属性详情"
  107. clearable
  108. style="width: 200px"
  109. @keyup.enter.native="handleQuery"
  110. />
  111. </el-form-item>
  112. </el-col>
  113. <el-col :span="6">
  114. <el-form-item label="入库状态" prop="fItemsStatus">
  115. <el-select
  116. style="width: 200px"
  117. v-model="queryParams.fItemsStatus"
  118. placeholder="请选择入库状态"
  119. >
  120. <el-option label="计划" value="1"></el-option>
  121. <el-option label="待入库" value="2"></el-option>
  122. <el-option label="入库中" value="3"></el-option>
  123. <el-option label="已入库" value="4"></el-option>
  124. </el-select>
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="6">
  128. <el-form-item label="费用状态" prop="fFeeStatus">
  129. <el-select
  130. style="width: 200px"
  131. v-model="queryParams.fFeeStatus"
  132. placeholder="请选择费用状态"
  133. >
  134. <el-option label="暂存" :value="1"></el-option>
  135. <el-option label="部分" :value="2"></el-option>
  136. <el-option label="全部入账" :value="3"></el-option>
  137. </el-select>
  138. </el-form-item>
  139. </el-col>
  140. </el-row>
  141. <el-row>
  142. <el-col :span="6">
  143. <el-form-item label="业务编号" prop="fBillno">
  144. <el-input
  145. v-model="queryParams.fBillno"
  146. placeholder="请输入业务编号"
  147. clearable
  148. @keyup.enter.native="handleQuery"
  149. style="width: 200px"
  150. />
  151. </el-form-item>
  152. </el-col>
  153. <el-col :span="6">
  154. <el-form-item label="制单人" prop="createBy">
  155. <el-select
  156. v-model="queryParams.createBy"
  157. filterable
  158. clearable
  159. placeholder="请输入关键词"
  160. style="width: 200px"
  161. >
  162. <el-option
  163. v-for="(item, index) in userOptions"
  164. :key="index.userName"
  165. :label="item.nickName"
  166. :value="item.userName"
  167. >
  168. </el-option>
  169. </el-select>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="6">
  173. <el-form-item label="仓库" prop="fWarehouseid">
  174. <el-select
  175. v-model="queryParams.fWarehouseid"
  176. clearable
  177. filterable
  178. placeholder="请选择仓库"
  179. style="width: 200px"
  180. @keyup.enter.native="handleQuery"
  181. >
  182. <el-option
  183. v-for="(item, index) in warehouseOptions"
  184. :key="index.fId"
  185. :label="item.fName"
  186. :value="item.fId"
  187. ></el-option>
  188. </el-select>
  189. </el-form-item>
  190. <!-- <el-form-item label="经营单位" prop="fSbu">-->
  191. <!-- <el-select-->
  192. <!-- v-model="queryParams.fSbu"-->
  193. <!-- clearable-->
  194. <!-- filterable-->
  195. <!-- placeholder="请输入关键词"-->
  196. <!-- style="width: 200px"-->
  197. <!-- >-->
  198. <!-- <el-option-->
  199. <!-- v-for="(item, index) in fMblnoOptions"-->
  200. <!-- :key="index.fId"-->
  201. <!-- :label="item.fName"-->
  202. <!-- :value="item.fId"-->
  203. <!-- ></el-option>-->
  204. <!-- </el-select>-->
  205. <!-- </el-form-item>-->
  206. </el-col>
  207. <el-col :span="6">
  208. <el-form-item label="贸易方式" prop="fTrademodeid">
  209. <el-select
  210. v-model="queryParams.fTrademodeid"
  211. placeholder="请选择贸易方式"
  212. clearable
  213. @keyup.enter.native="handleQuery"
  214. style="width: 200px"
  215. >
  216. <el-option
  217. v-for="(item, index) in fTrademodeidOptions"
  218. :key="index.dictValue"
  219. :label="item.dictLabel"
  220. :value="item.dictValue"
  221. />
  222. </el-select>
  223. </el-form-item>
  224. </el-col>
  225. </el-row>
  226. <el-row>
  227. <el-col :span="6">
  228. <el-form-item label="箱使日期" prop="freeContainerList">
  229. <el-date-picker
  230. v-model="queryParams.freeContainerList"
  231. type="daterange"
  232. value-format="yyyy-MM-dd HH:mm:ss"
  233. :default-time="['00:00:00', '23:59:59']"
  234. clearable
  235. style="width: 230px"
  236. range-separator="至"
  237. start-placeholder="开始日期"
  238. end-placeholder="结束日期"
  239. @keyup.enter.native="handleQuery"
  240. >
  241. </el-date-picker>
  242. </el-form-item>
  243. </el-col>
  244. <el-col :span="6" v-if="company === '青岛金港物流有限公司'">
  245. <el-form-item label="报关单号">
  246. <el-input
  247. v-model="queryParams.fCustomno"
  248. placeholder="请输入报关单号"
  249. clearable
  250. style="width: 200px"
  251. />
  252. </el-form-item>
  253. </el-col>
  254. <el-col :span="6" v-if="company === '青岛金港物流有限公司'">
  255. <el-form-item label="境内收货人" prop="fSbu">
  256. <el-select
  257. v-model="queryParams.fSbu"
  258. clearable
  259. filterable
  260. placeholder="请输入关键词"
  261. style="width: 200px"
  262. >
  263. <el-option
  264. v-for="(item, index) in fSbuOptions"
  265. :key="index.fId"
  266. :label="item.fName"
  267. :value="item.fId"
  268. ></el-option>
  269. </el-select>
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. </div>
  274. </el-collapse-transition>
  275. </el-form>
  276. <el-row :gutter="10" class="mb8">
  277. <el-col :span="1.5">
  278. <el-button
  279. type="primary"
  280. icon="el-icon-plus"
  281. size="mini"
  282. @click="handleAdd"
  283. v-hasPermi="['warehouseBusiness:inStock:add']"
  284. >新增
  285. </el-button>
  286. </el-col>
  287. <el-col :span="1.5">
  288. <el-button
  289. type="success"
  290. icon="el-icon-edit"
  291. size="mini"
  292. :disabled="single"
  293. @click="handleUpdate"
  294. v-hasPermi="['warehouseBusiness:inStock:edit']"
  295. >修改
  296. </el-button>
  297. </el-col>
  298. <el-col :span="1.5">
  299. <el-button
  300. type="warning"
  301. icon="el-icon-download"
  302. size="mini"
  303. @click="handleExport"
  304. v-hasPermi="['warehouseBusiness:inStock:export']"
  305. >导出
  306. </el-button>
  307. </el-col>
  308. <el-col :span="1.5">
  309. <el-button
  310. type="info"
  311. icon="el-icon-download"
  312. size="mini"
  313. :disabled="single"
  314. @click="copyUpdate"
  315. v-hasPermi="['agreement:agreementStorage:export']"
  316. >复制新增
  317. </el-button>
  318. </el-col>
  319. <div class="tabSetting">
  320. <div style="margin-right: 20px">
  321. <el-button
  322. type="cyan"
  323. icon="el-icon-search"
  324. size="mini"
  325. @click="handleQuery"
  326. >搜索</el-button
  327. >
  328. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  329. >重置</el-button
  330. >
  331. <el-button
  332. v-show="show"
  333. @click="show = !show"
  334. icon="el-icon-arrow-up"
  335. size="mini"
  336. >展开</el-button
  337. >
  338. <el-button
  339. v-show="!show"
  340. @click="show = !show"
  341. icon="el-icon-arrow-down"
  342. size="mini"
  343. >展开</el-button
  344. >
  345. </div>
  346. <right-toolbar
  347. :showSearch.sync="showSearch"
  348. @queryTable="getList"
  349. ></right-toolbar>
  350. <div style="margin: 0 12px">
  351. <el-button
  352. icon="el-icon-setting"
  353. size="mini"
  354. circle
  355. @click="showSetting = !showSetting"
  356. ></el-button>
  357. </div>
  358. </div>
  359. </el-row>
  360. <el-dialog
  361. title="自定义列显示"
  362. :visible.sync="showSetting"
  363. width="700px"
  364. v-dialogDrag
  365. :close-on-click-modal="false"
  366. >
  367. <template slot="title">
  368. <div class="avue-crud__dialog__header">
  369. <span class="el-dialog__title">
  370. <span
  371. style="
  372. display: inline-block;
  373. width: 3px;
  374. height: 20px;
  375. margin-right: 5px;
  376. float: left;
  377. margin-top: 2px;
  378. "
  379. ></span>
  380. </span>
  381. </div>
  382. </template>
  383. <div>配置排序列数据(拖动调整顺序)</div>
  384. <div style="margin-left: 17px">
  385. <el-checkbox
  386. v-model="allCheck"
  387. label="全选"
  388. @change="allChecked"
  389. ></el-checkbox>
  390. </div>
  391. <div style="padding: 4px; display: flex; justify-content: center">
  392. <draggable
  393. v-model="setRowList"
  394. group="site"
  395. animation="300"
  396. @start="onStart"
  397. @end="onEnd"
  398. handle=".indraggable"
  399. >
  400. <transition-group>
  401. <div
  402. v-for="item in setRowList"
  403. :key="item.surface"
  404. class="listStyle"
  405. >
  406. <div style="width: 500px" class="indraggable">
  407. <div class="progress" :style="{ width: item.width + 'px' }">
  408. <el-checkbox
  409. :label="item.name"
  410. v-model="item.checked"
  411. :true-label="0"
  412. :false-label="1"
  413. >{{ item.name }}
  414. </el-checkbox>
  415. </div>
  416. </div>
  417. <el-input-number
  418. v-model.number="item.width"
  419. controls-position="right"
  420. :min="1"
  421. :max="500"
  422. size="mini"
  423. ></el-input-number>
  424. </div>
  425. </transition-group>
  426. </draggable>
  427. </div>
  428. <span slot="footer" class="dialog-footer">
  429. <el-button @click="showSetting = false">取 消</el-button>
  430. <el-button @click="delRow" type="danger">重 置</el-button>
  431. <el-button type="primary" @click="save()">确 定</el-button>
  432. </span>
  433. </el-dialog>
  434. <el-table
  435. ref="table"
  436. v-loading="loading"
  437. :data="warehousebillsList"
  438. @selection-change="handleSelectionChange"
  439. show-summary
  440. :summary-method="getSum"
  441. :height="tableHeight"
  442. @expand-change="expandChange"
  443. >
  444. <el-table-column type="selection" fixed align="center" width="58" />
  445. <el-table-column type="expand" fixed="left">
  446. <template slot-scope="props">
  447. <el-table
  448. :data="props.row.dataList"
  449. v-loading="props.row.loading"
  450. >
  451. <el-table-column
  452. type="index"
  453. label="行号"
  454. width="50"
  455. align="center"
  456. fixed
  457. />
  458. <el-table-column label="状态" prop="fBillstatus" align="center" show-overflow-tooltip width="100">
  459. <template slot-scope="scope">
  460. {{ scope.row.fBillstatus | fBillstatusFormat }}
  461. </template>
  462. </el-table-column>
  463. <el-table-column label="入库日期" prop="fBsdate" align="center" show-overflow-tooltip width="100">
  464. </el-table-column>
  465. <el-table-column label="品名" prop="fGoodsid" align="center" show-overflow-tooltip width="100">
  466. <template slot-scope="scope">
  467. {{ scope.row.fGoodsid | goodsFormat(goodsOptions) }}
  468. </template>
  469. </el-table-column>
  470. <el-table-column label="货物属性" prop="fBusinessType" align="center" show-overflow-tooltip width="100">
  471. <template slot-scope="scope">
  472. {{ scope.row.fBusinessType | fStorageTypeFormat(fStorageTypeOptions) }}
  473. </template>
  474. </el-table-column>
  475. <el-table-column label="属性详情" prop="fMarks" align="center" show-overflow-tooltip width="100">
  476. </el-table-column>
  477. <el-table-column label="入库件数" prop="fQty" align="center" show-overflow-tooltip width="100">
  478. </el-table-column>
  479. <el-table-column label="入库毛重(kg)" prop="fGrossweight" align="center" show-overflow-tooltip width="150">
  480. </el-table-column>
  481. <el-table-column label="入库净重(kg)" prop="fNetweight" align="center" show-overflow-tooltip width="150">
  482. </el-table-column>
  483. <el-table-column label="箱号" prop="fCntrno" align="center" show-overflow-tooltip width="180">
  484. </el-table-column>
  485. </el-table>
  486. </template>
  487. </el-table-column>
  488. <el-table-column
  489. type="index"
  490. label="行号"
  491. align="center"
  492. fixed
  493. />
  494. <el-table-column
  495. v-for="(item, index) in getRowList"
  496. :key="index"
  497. :label="item.name"
  498. :width="item.width"
  499. :prop="item.label"
  500. align="center"
  501. :fixed="item.fixed"
  502. :show-overflow-tooltip="true"
  503. sortable
  504. >
  505. <template slot-scope="scope">
  506. <span v-if="item.label == 'fMblno'">
  507. <el-link :underline="false" type="primary"
  508. ><div @click="handleUpdate(scope.row)">
  509. {{ scope.row.fMblno }}
  510. </div></el-link
  511. >
  512. </span>
  513. <span v-else>{{ scope.row[item.label] }}</span>
  514. </template>
  515. </el-table-column>
  516. <el-table-column
  517. label="操作"
  518. align="center"
  519. class-name="small-padding fixed-width"
  520. min-width="200"
  521. fixed="right"
  522. >
  523. <template slot-scope="scope">
  524. <el-button
  525. size="mini"
  526. type="text"
  527. icon="el-icon-edit"
  528. @click="handleUpdate(scope.row, true)"
  529. v-hasPermi="['warehouseBusiness:inStock:edit']"
  530. >查看
  531. </el-button>
  532. <el-button
  533. size="mini"
  534. type="text"
  535. icon="el-icon-edit"
  536. v-if="
  537. scope.row.fBillstatus == '录入' ||
  538. scope.row.fBillstatus == '暂存' ||
  539. scope.row.fBillstatus == '驳回'
  540. "
  541. @click="handleUpdate(scope.row, false)"
  542. v-hasPermi="['warehouseBusiness:inStock:edit']"
  543. >修改
  544. </el-button>
  545. <el-button
  546. size="mini"
  547. type="text"
  548. icon="el-icon-delete"
  549. v-if="(scope.row.fItemsStatus == '待入库' || scope.row.fItemsStatus == '计划') && scope.row.warehouseStatus < 4 && scope.row.isCreate == 1 || (scope.row.fItemsStatus == '待入库' || scope.row.fItemsStatus == '计划') && scope.row.warehouseStatus < 4 && scope.row.isCreate == 0"
  550. @click="handleDelete(scope.row)"
  551. v-hasPermi="['warehouseBusiness:inStock:remove']"
  552. >删除
  553. </el-button>
  554. <el-button
  555. size="mini"
  556. type="text"
  557. icon="el-icon-delete"
  558. v-if="
  559. scope.row.fBillstatus == '请核' ||
  560. scope.row.fBillstatus == '审核中'
  561. "
  562. @click="handleUpdate(scope.row, true)"
  563. >审核进度
  564. </el-button>
  565. </template>
  566. </el-table-column>
  567. </el-table>
  568. <pagination
  569. v-show="total > 0"
  570. :total="total"
  571. :page.sync="queryParams.pageNum"
  572. :limit.sync="queryParams.pageSize"
  573. @pagination="getList"
  574. />
  575. </div>
  576. <add-or-update
  577. v-show="pageShow2"
  578. @changeShow="showAddOrUpdate"
  579. ref="addOrUpdateRef"
  580. :chiId="formId"
  581. :copyStatus="copyStatus"
  582. :key="timer"
  583. ></add-or-update>
  584. </div>
  585. </template>
  586. <script>
  587. import AddOrUpdate from "./AddOrUpdate.vue";
  588. import {
  589. listWarehousebills,
  590. delinStock_s,
  591. delWarehousebills,
  592. getWarehousebills,
  593. exportWarehousebills,
  594. } from "@/api/warehouseBusiness/warehouseInStock";
  595. import { listCorps } from "@/api/basicdata/corps";
  596. import { listWarehousesss } from "@/api/basicdata/warehouse";
  597. import { listGoods ,queryVehicle} from "@/api/basicdata/goods";
  598. import { listUser, queryUserVal } from "@/api/system/user";
  599. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  600. import Cookies from "js-cookie";
  601. import { addSet, select, resetModule } from "@/api/system/set";
  602. import draggable from "vuedraggable";
  603. export default {
  604. name: "plans",
  605. data() {
  606. return {
  607. // 明细数据
  608. warehouseDetailed: [],
  609. // 货物属性
  610. fStorageTypeOptions: [],
  611. tableHeight: '600',
  612. timer: "",
  613. pageShow: true,
  614. pageShow2: false,
  615. queryParams: {
  616. pageNum: 1,
  617. pageSize: 10,
  618. fBillno: null,
  619. createBy: null,
  620. fTrademodeid: null,
  621. fCorpid: null,
  622. fMblno: null,
  623. fSbu: null,
  624. fGoodsid: null,
  625. fWarehouseid: null,
  626. fMarks: null,
  627. fBillstatus: null,
  628. fItemsStatus: null,
  629. timeInterval: null,
  630. fFeeStatus: null,
  631. },
  632. // 显示搜索条件
  633. showSearch: true,
  634. userOptions: [],
  635. fTrademodeidOptions: [],
  636. warehouseOptions: [],
  637. goodsOptions: [],
  638. fMblnoOptions: [],
  639. show: false,
  640. drag: false,
  641. tableDate: [
  642. {
  643. surface: "1",
  644. label: "fMblno",
  645. name: "提单号",
  646. checked: 0,
  647. width: 200,
  648. fixed: "left",
  649. },
  650. {
  651. surface: "2",
  652. label: "createBy",
  653. name: "制单人",
  654. checked: 0,
  655. width: 100,
  656. },
  657. {
  658. surface: "3",
  659. label: "fItemsStatus",
  660. name: "入库状态",
  661. checked: 0,
  662. // fixed: "left",
  663. width: 100,
  664. },
  665. {
  666. surface: "4",
  667. label: "fCorpid",
  668. name: "客户",
  669. checked: 0,
  670. // fixed: "left",
  671. width: 100,
  672. },
  673. {
  674. surface: "5",
  675. label: "fGoodsid",
  676. name: "品名",
  677. checked: 0,
  678. // fixed: "left",
  679. width: 100,
  680. },
  681. {
  682. surface: "6",
  683. label: "fMarks",
  684. name: "属性详情",
  685. checked: 0,
  686. width: 100,
  687. },
  688. {
  689. surface: "7",
  690. label: "fBsdate",
  691. name: "入库日期",
  692. checked: 0,
  693. // fixed: "left",
  694. width: 100,
  695. },
  696. {
  697. surface: "8",
  698. label: "fWarehouseid",
  699. name: "仓库",
  700. checked: 0,
  701. width: 100,
  702. },
  703. {
  704. surface: "9",
  705. label: "fPlanqty",
  706. name: "计划件数",
  707. checked: 0,
  708. width: 120,
  709. },
  710. {
  711. surface: "10",
  712. label: "fQty",
  713. name: "入库件数",
  714. checked: 0,
  715. width: 120,
  716. },
  717. {
  718. surface: "11",
  719. label: "fGrossweight",
  720. name: "入库毛重",
  721. checked: 0,
  722. width: 120,
  723. },
  724. {
  725. surface: "12",
  726. label: "fNetweight",
  727. name: "入库净重",
  728. checked: 0,
  729. width: 120,
  730. },
  731. {
  732. surface: "13",
  733. label: "fCntval",
  734. name: "箱型箱量",
  735. checked: 0,
  736. width: 120,
  737. },
  738. {
  739. surface: "14",
  740. label: "fTruckno",
  741. name: "车号",
  742. checked: 0,
  743. width: 100,
  744. },
  745. {
  746. surface: "15",
  747. label: "fDriverName",
  748. name: "司机名称",
  749. checked: 0,
  750. width: 100,
  751. },
  752. {
  753. surface: "16",
  754. label: "fDriverTel",
  755. name: "司机电话",
  756. checked: 0,
  757. width: 100,
  758. },
  759. {
  760. surface: "17",
  761. label: "fDriverIdCar",
  762. name: "司机身份证",
  763. checked: 0,
  764. width: 180,
  765. },
  766. {
  767. surface: "18",
  768. label: "fBusinessType",
  769. name: "业务类别",
  770. checked: 0,
  771. width: 100,
  772. },
  773. {
  774. surface: "19",
  775. label: "fFeeStatus",
  776. name: "费用状态",
  777. checked: 0,
  778. width: 100,
  779. },
  780. {
  781. surface: "20",
  782. label: "freeContainerDate",
  783. name: "箱使日期",
  784. checked: 0,
  785. width: 100,
  786. },
  787. {
  788. surface: "21",
  789. label: "fStorekeeper",
  790. name: "仓管员",
  791. checked: 0,
  792. width: 100,
  793. },
  794. {
  795. surface: "22",
  796. label: "fBillno",
  797. name: "系统编号",
  798. checked: 0,
  799. width: 100,
  800. },
  801. {
  802. surface: "23",
  803. label: "fReceivable",
  804. name: "应收合计",
  805. checked: 0,
  806. width: 100,
  807. },
  808. {
  809. surface: "24",
  810. label: "fDue",
  811. name: "应付合计",
  812. checked: 0,
  813. width: 100,
  814. },
  815. {
  816. surface: "25",
  817. label: "",
  818. name: "利润",
  819. checked: 0,
  820. width: 100,
  821. },
  822. {
  823. surface: "26",
  824. label: "fRecycle",
  825. name: "实收合计",
  826. checked: 0,
  827. width: 100,
  828. },
  829. {
  830. surface: "27",
  831. label: "fPay",
  832. name: "实付合计",
  833. checked: 0,
  834. width: 100,
  835. },
  836. {
  837. surface: "28",
  838. label: "remark",
  839. name: "备注",
  840. checked: 0,
  841. width: 100,
  842. }
  843. ],
  844. setRowList: [],
  845. getRowList: [],
  846. allCheck: false,
  847. showSetting: false,
  848. total: 0,
  849. warehousebillsList: [],
  850. loading: true,
  851. single: true,
  852. multiple: true,
  853. formId: null,
  854. ids: [],
  855. copyStatus: null,
  856. fTrucknoList:[],
  857. // 公司名称
  858. company: '',
  859. fSbuOptions: [],
  860. pickerOptions: {
  861. shortcuts: [{
  862. text: '最近一周',
  863. onClick(picker) {
  864. const end = new Date();
  865. const start = new Date();
  866. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  867. picker.$emit('pick', [start, end]);
  868. }
  869. }, {
  870. text: '最近一个月',
  871. onClick(picker) {
  872. const end = new Date();
  873. const start = new Date();
  874. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  875. picker.$emit('pick', [start, end]);
  876. }
  877. }, {
  878. text: '最近三个月',
  879. onClick(picker) {
  880. const end = new Date();
  881. const start = new Date();
  882. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  883. picker.$emit('pick', [start, end]);
  884. }
  885. }]
  886. },
  887. };
  888. },
  889. // 使用子组件
  890. components: { draggable, AddOrUpdate },
  891. created() {
  892. let date = new Date();
  893. let lYear = parseInt(date.getFullYear())
  894. let lMonth = parseInt(date.getMonth())
  895. if (lMonth == 0) {
  896. lMonth = 12
  897. lYear = lYear - 1
  898. }
  899. let nYear = parseInt(date.getFullYear())
  900. let nMonth = parseInt(date.getMonth() + 2)
  901. if (nMonth > 12) {
  902. nMonth = nMonth - 12
  903. nYear = nYear + 1
  904. }
  905. let day30 = [4, 6, 9, 11]
  906. let day31 = [1, 3, 5, 7, 8, 10, 12]
  907. let nDay = null
  908. if (day31.indexOf(nMonth) > -1) {
  909. nDay = 31
  910. } else if (day30.indexOf(nMonth) > -1) {
  911. nDay = 30
  912. } else if ((nYear % 4 == 0) && (nYear % 100 != 0 || nYear % 400 == 0)) {
  913. nDay = 29
  914. } else {
  915. nDay = 28
  916. }
  917. this.queryParams.timeInterval = [lYear + '-' + lMonth + '-' + '01 00:00:00', nYear + '-' + nMonth + '-' + nDay + ' 23:59:59']
  918. this.setRowList = this.tableDate;
  919. this.getRowList = this.tableDate;
  920. this.getDicts("data_trademodes").then((response) => {
  921. this.fTrademodeidOptions = response.data;
  922. });
  923. this.getDicts("storage_type").then((response) => {
  924. this.fStorageTypeOptions = response.data;
  925. localStorage.setItem("fStorageTypeList", JSON.stringify(response.data));
  926. });
  927. listGoods({ fStatus: 0, delFlag: 0 }).then((response) => {
  928. this.goodsOptions = response.rows;
  929. });
  930. queryVehicle().then(res=>{
  931. this.fTrucknoList = res.data
  932. })
  933. listWarehousesss({ fStatus: 0, delFlag: 0 }).then((response) => {
  934. this.warehouseOptions = response.rows;
  935. });
  936. listUser().then((response) => {
  937. this.userOptions = response.rows;
  938. });
  939. listCorps({ type: 1 }).then((response) => {
  940. this.fMblnoOptions = response.rows;
  941. });
  942. listCorps().then((response) => {
  943. this.fSbuOptions = response.rows;
  944. });
  945. this.company = Cookies.get("companyName")
  946. this.getRow();
  947. this.getList();
  948. },
  949. activated() {
  950. if (this.$route.query.id) {
  951. this.handleUpdate(this.$route.query.id);
  952. }
  953. },
  954. mounted() {
  955. this.$nextTick(() => {
  956. // 监听浏览器高度变化,改变表格高度
  957. window.onresize = () => {
  958. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  959. }
  960. })
  961. },
  962. filters: {
  963. fBillstatusFormat(row) {
  964. let Name;
  965. switch (row) {
  966. case 10:
  967. Name = "计划";
  968. break;
  969. case 20:
  970. Name = "待入库";
  971. break;
  972. case 30:
  973. Name = "入库中";
  974. break;
  975. default:
  976. Name = "已入库";
  977. }
  978. return Name;
  979. },
  980. goodsFormat(row, goodsOptions) {
  981. let goods;
  982. goodsOptions.map((e) => {
  983. if (row == e.fId) {
  984. goods = e.fName;
  985. }
  986. });
  987. return goods;
  988. },
  989. fStorageTypeFormat(row, fStorageTypeOptions) {
  990. let fStorageType;
  991. fStorageTypeOptions.map((e) => {
  992. if (row == e.dictValue) {
  993. fStorageType = e.dictLabel;
  994. }
  995. });
  996. return fStorageType;
  997. },
  998. },
  999. methods: {
  1000. // 获取当前月的第一天和最后一天
  1001. // getMonth() {
  1002. // let date = new Date();
  1003. // let year = parseInt(date.getFullYear())
  1004. // let month = parseInt(date.getMonth() + 1)
  1005. // let currentMonth = date.getMonth()
  1006. // let nextMonth = ++currentMonth
  1007. // let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1) // 下个月的第一天
  1008. // let oneDay = 1000*60*60*24
  1009. // let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
  1010. // let day = lastTime.getDate()
  1011. // if (day < 10) {
  1012. // day = '0' + day
  1013. // }
  1014. // this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
  1015. // },
  1016. //列设置全选
  1017. allChecked() {
  1018. if (this.allCheck == true) {
  1019. this.setRowList.map((e) => {
  1020. return (e.checked = 0);
  1021. });
  1022. } else {
  1023. this.setRowList.map((e) => {
  1024. return (e.checked = 1);
  1025. });
  1026. }
  1027. },
  1028. //查询列数据
  1029. getRow() {
  1030. let that = this;
  1031. this.data = {
  1032. tableName: "入库",
  1033. userId: Cookies.get("userName"),
  1034. };
  1035. select(this.data).then((res) => {
  1036. if (res.data.length != 0) {
  1037. this.getRowList = res.data.filter((e) => e.checked == 0);
  1038. this.setRowList = res.data;
  1039. this.setRowList = this.setRowList.reduce((res, item) => {
  1040. res.push({
  1041. surface: item.surface,
  1042. label: item.label,
  1043. name: item.name,
  1044. checked: item.checked,
  1045. width: item.width,
  1046. fixed: item.fixed,
  1047. });
  1048. return res;
  1049. }, []);
  1050. }
  1051. });
  1052. },
  1053. //重置列表
  1054. delRow() {
  1055. this.data = {
  1056. tableName: "入库",
  1057. userId: Cookies.get("userName"),
  1058. };
  1059. resetModule(this.data).then((res) => {
  1060. if (res.code == 200) {
  1061. this.showSetting = false;
  1062. this.setRowList = this.$options.data().tableDate;
  1063. this.getRowList = this.$options.data().tableDate;
  1064. }
  1065. });
  1066. },
  1067. //保存列设置
  1068. save() {
  1069. this.showSetting = false;
  1070. this.data = {
  1071. tableName: "入库",
  1072. userId: Cookies.get("userName"),
  1073. sysTableSetList: this.setRowList,
  1074. };
  1075. addSet(this.data).then((res) => {
  1076. if (res.code == 200) {
  1077. this.showSetting = false;
  1078. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  1079. }
  1080. });
  1081. },
  1082. //开始拖拽事件
  1083. onStart() {
  1084. this.drag = true;
  1085. },
  1086. //拖拽结束事件
  1087. onEnd() {
  1088. this.drag = false;
  1089. },
  1090. getList() {
  1091. //获取仓库
  1092. listWarehousebills(this.queryParams).then((response) => {
  1093. response.rows.map((e) => {
  1094. e.freeContainerDate = e.freeContainerDate
  1095. ? e.freeContainerDate.substring(0, 10)
  1096. : null;
  1097. });
  1098. this.warehousebillsList = response.rows;
  1099. this.warehousebillsList.forEach(item => {
  1100. this.$set(item,'dataList',[])
  1101. this.$set(item,'loading', true)
  1102. })
  1103. this.total = response.total;
  1104. this.loading = false;
  1105. // 根据浏览器高度设置初始高度
  1106. setTimeout(() => {
  1107. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  1108. }, 300)
  1109. });
  1110. },
  1111. //合计
  1112. getSum(param) {
  1113. const { columns, data } = param;
  1114. const sums = [];
  1115. var values = [];
  1116. columns.forEach((column, index) => {
  1117. if (index === 0) {
  1118. sums[index] = "合计";
  1119. return;
  1120. }
  1121. if (column.property === "fGrossweight") {
  1122. values = data.map((item) => Number(item["fGrossweight"]));
  1123. }
  1124. if (column.property === "fNetweight") {
  1125. values = data.map((item) => Number(item["fNetweight"]));
  1126. }
  1127. if (column.property === "fQty") {
  1128. values = data.map((item) => Number(item["fQty"]));
  1129. }
  1130. if (column.property === "fPlanqty") {
  1131. values = data.map((item) => Number(item.fPlanqty));
  1132. }
  1133. if (
  1134. column.property === "fGrossweight" ||
  1135. column.property === "fNetweight" ||
  1136. column.property === "fQty" ||
  1137. column.property === "fPlanqty"
  1138. ) {
  1139. sums[index] = values.reduce((prev, curr) => {
  1140. const value = Number(curr);
  1141. if (!isNaN(value)) {
  1142. return prev + curr;
  1143. } else {
  1144. return prev;
  1145. }
  1146. }, 0);
  1147. if (column.property === "fGrossweight") {
  1148. sums[index] = (sums[index] / 1000).toFixed(4) + "(吨)";
  1149. }
  1150. if (column.property === "fNetweight") {
  1151. sums[index] = (sums[index] / 1000).toFixed(4) + "(吨)";
  1152. }
  1153. if (column.property === "fQty") {
  1154. // sums[index] = sums[index].toFixed(2);
  1155. sums[index] = sums[index];
  1156. }
  1157. if (column.property === "fPlanqty") {
  1158. if (sums[index]) {
  1159. sums[index] = sums[index];
  1160. }
  1161. }
  1162. }
  1163. });
  1164. return sums;
  1165. },
  1166. handleAdd() {
  1167. this.timer = new Date().getTime();
  1168. this.pageShow = false;
  1169. this.pageShow2 = true;
  1170. },
  1171. // 多选框选中数据
  1172. handleSelectionChange(selection) {
  1173. this.ids = selection.map((item) => item.fId);
  1174. this.single =
  1175. selection.length !== 1 ||
  1176. selection.map((item) => item.fBillstatus) == 6 ||
  1177. selection.map((item) => item.fBillstatus) == 4;
  1178. this.multiple = !selection.length;
  1179. },
  1180. /** 修改按钮操作 */
  1181. handleUpdate(row) {
  1182. const fId = row.fId || this.ids[0] || row;
  1183. this.copyStatus = null;
  1184. this.formId = fId;
  1185. this.$nextTick(() => {
  1186. this.$refs.addOrUpdateRef.init();
  1187. });
  1188. setTimeout(() => {
  1189. this.pageShow = false;
  1190. this.pageShow2 = true;
  1191. }, 200);
  1192. },
  1193. copyUpdate() {
  1194. this.formId = this.ids[0];
  1195. this.copyStatus = 2;
  1196. this.$nextTick(() => {
  1197. this.$refs.addOrUpdateRef.init();
  1198. });
  1199. setTimeout(() => {
  1200. this.pageShow = false;
  1201. this.pageShow2 = true;
  1202. }, 200);
  1203. },
  1204. /** 删除按钮操作 */
  1205. handleDelete(row) {
  1206. const ids = row.fId || this.ids;
  1207. delinStock_s(ids).then((data) => {
  1208. switch (data.msg) {
  1209. case "0": {
  1210. this.$message.error("当前数据已被其他操作员操作请刷新页面");
  1211. break;
  1212. }
  1213. case "1": {
  1214. this.delete(ids, "当前主表有数据从表无数据是否删除");
  1215. break;
  1216. }
  1217. case "2": {
  1218. this.delete(ids, "当前主表有数据从表有数据是否删除");
  1219. break;
  1220. }
  1221. default: {
  1222. return this.$message.error("未知错误,无状态");
  1223. }
  1224. }
  1225. this.getList()
  1226. });
  1227. },
  1228. delete(ids, tips) {
  1229. this.$confirm(tips, "警告", {
  1230. confirmButtonText: "确定",
  1231. cancelButtonText: "取消",
  1232. type: "warning",
  1233. }).then(() => {
  1234. delWarehousebills(ids);
  1235. this.msgSuccess("删除成功");
  1236. this.getList();
  1237. });
  1238. },
  1239. /** 导出按钮操作 */
  1240. handleExport() {
  1241. this.$confirm('是否确认导出', '警告', {
  1242. confirmButtonText: "确定",
  1243. cancelButtonText: "取消",
  1244. type: "warning",
  1245. }).then(() => {
  1246. exportWarehousebills(this.queryParams).then(res => {
  1247. this.download(res.msg);
  1248. })
  1249. })
  1250. // require.ensure([], () => {
  1251. // const { export_json_to_excel } = require("../../../excel/Export2Excel");
  1252. // const tHeader = ["客户名称", "制单日期"];
  1253. // // 上面设置Excel的表格第一行的标题
  1254. // const filterVal = ["corpId", "createTime"];
  1255. // // 上面的index、nickName、name是tableData里对象的属性
  1256. // const list = this.ftmsorderbillsList; //把data里的tableData存到list
  1257. // const data = this.formatJson(filterVal, list);
  1258. // export_json_to_excel(
  1259. // tHeader,
  1260. // data,
  1261. // "列表excel",
  1262. // true,
  1263. // );
  1264. // });
  1265. },
  1266. formatJson(filterVal, jsonData) {
  1267. return jsonData.map((v) => filterVal.map((j) => v[j]));
  1268. },
  1269. /** 搜索按钮操作 */
  1270. handleQuery() {
  1271. this.queryParams.pageNum = 1;
  1272. this.getList();
  1273. },
  1274. /** 重置按钮操作 */
  1275. resetQuery() {
  1276. this.queryParams = {
  1277. pageNum: 1,
  1278. pageSize: 10,
  1279. fBillno: null,
  1280. createBy: null,
  1281. fTrademodeid: null,
  1282. fCorpid: null,
  1283. fMblno: null,
  1284. fSbu: null,
  1285. fGoodsid: null,
  1286. fWarehouseid: null,
  1287. fMarks: null,
  1288. fBillstatus: null,
  1289. fItemsStatus: null,
  1290. timeInterval: null,
  1291. fFeeStatus: null,
  1292. };
  1293. this.handleQuery();
  1294. },
  1295. showAddOrUpdate(data) {
  1296. if (data) {
  1297. this.getList();
  1298. this.pageShow = true;
  1299. this.pageShow2 = false;
  1300. }
  1301. },
  1302. expandChange(row,index) {
  1303. if (row.loading == true) {
  1304. getWarehousebills(row.fId).then(res => {
  1305. row.dataList = res.data.warehouseBillsItem
  1306. // this.$set(row,'dataList',res.data.warehouseBillsItem)
  1307. row.loading = false;
  1308. })
  1309. }
  1310. },
  1311. },
  1312. };
  1313. </script>
  1314. <style scoped>
  1315. </style>