index.vue 41 KB

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