sum_list.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowPrint">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form
  7. ref="screenForm"
  8. :model="screenForm"
  9. label-width="120px"
  10. size="mini"
  11. label-position="left"
  12. >
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="产品名称" prop="goodsName">
  16. <el-input
  17. v-model="screenForm.goodsName"
  18. placeholder="请输入产品名称"
  19. ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="物料编码" prop="goodsCode">
  24. <el-input
  25. v-model="screenForm.goodsCode"
  26. placeholder="请输入物料编码"
  27. ></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :xs="24" :sm="12" :lg="6">
  31. <el-form-item label="产品编码" prop="goodsOldCode">
  32. <el-input
  33. v-model="screenForm.goodsOldCode"
  34. placeholder="请输入产品编码"
  35. ></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="12" :lg="6">
  39. <el-form-item label="规格型号" prop="model">
  40. <el-input
  41. v-model="screenForm.model"
  42. placeholder="请输入规格型号"
  43. ></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :xs="24" :sm="12" :lg="6">
  47. <el-form-item label="制单日期" prop="createDate">
  48. <el-date-picker
  49. v-model="screenForm.createDate"
  50. type="datetimerange"
  51. range-separator="至"
  52. style="width: 100%"
  53. value-format="yyyy-MM-dd HH:mm:ss"
  54. start-placeholder="开始日期"
  55. end-placeholder="结束日期"
  56. >
  57. </el-date-picker>
  58. </el-form-item>
  59. </el-col>
  60. <el-col :xs="24" :sm="12" :lg="6">
  61. <el-form-item label="发货日期" prop="deliverDate">
  62. <el-date-picker
  63. v-model="screenForm.deliverDate"
  64. type="datetimerange"
  65. range-separator="至"
  66. style="width: 100%"
  67. value-format="yyyy-MM-dd HH:mm:ss"
  68. start-placeholder="开始日期"
  69. end-placeholder="结束日期"
  70. >
  71. </el-date-picker>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :xs="24" :sm="12" :lg="6">
  75. <el-form-item label="经销商编号" prop="jxsNum">
  76. <el-input
  77. v-model="screenForm.jxsNum"
  78. placeholder="请输入经销商编号"
  79. ></el-input>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :xs="24" :sm="12" :lg="6">
  83. <el-form-item label="经销商名称" prop="jxsName">
  84. <el-input
  85. v-model="screenForm.jxsName"
  86. placeholder="请输入经销商名称"
  87. ></el-input>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :xs="24" :sm="12" :lg="6">
  91. <el-form-item label="发货单号" prop="orderNum">
  92. <el-input
  93. v-model="screenForm.orderNum"
  94. placeholder="请输入发货单号"
  95. ></el-input>
  96. </el-form-item>
  97. </el-col>
  98. <el-col :xs="24" :sm="12" :lg="6">
  99. <el-form-item label="订单" prop="mainOrderId">
  100. <el-input
  101. v-model="screenForm.mainOrderId"
  102. placeholder="请输入订单"
  103. ></el-input>
  104. </el-form-item>
  105. </el-col>
  106. <el-col :xs="24" :sm="12" :lg="6">
  107. <el-form-item label="存货类别" prop="type">
  108. <el-select
  109. v-model="screenForm.type"
  110. placeholder="选择存货类别"
  111. style="width: 100%"
  112. clearable
  113. >
  114. <el-option
  115. v-for="item in categoryList"
  116. :key="item.name"
  117. :label="item.name"
  118. :value="item.name"
  119. >
  120. </el-option>
  121. </el-select>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :xs="24" :sm="12" :lg="6">
  125. <el-form-item label="仓库" prop="correspondId">
  126. <el-select
  127. v-model="screenForm.correspondId"
  128. multiple
  129. style="width: 100%"
  130. placeholder="请选择仓库"
  131. size="mini"
  132. filterable
  133. clearable
  134. >
  135. <el-option
  136. v-for="(item, index) in warehouseList"
  137. :key="index"
  138. :label="item.name"
  139. :value="item.id"
  140. />
  141. </el-select>
  142. </el-form-item>
  143. </el-col>
  144. <el-col :xs="24" :sm="12" :lg="6">
  145. <el-form-item label="表头业务员" prop="k3ServiceId">
  146. <el-select
  147. v-model="screenForm.k3ServiceId"
  148. placeholder="选择表头业务员"
  149. clearable
  150. filterable
  151. style="width: 100%"
  152. >
  153. <el-option
  154. v-for="item in salesmanList"
  155. :key="item.adminUserId"
  156. :label="item.nickName"
  157. :value="item.adminUserId"
  158. >
  159. </el-option>
  160. </el-select>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :xs="24" :sm="12" :lg="6">
  164. <el-form-item label="表体业务员" prop="salesMan">
  165. <el-select
  166. v-model="screenForm.salesMan"
  167. placeholder="选择表体业务员"
  168. clearable
  169. filterable
  170. style="width: 100%"
  171. >
  172. <el-option
  173. v-for="item in salesmanList"
  174. :key="item.adminUserId"
  175. :label="item.nickName"
  176. :value="item.adminUserId"
  177. >
  178. </el-option>
  179. </el-select>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :xs="24" :sm="12" :lg="6">
  183. <el-form-item label="审核时间" prop="approvaTime">
  184. <el-date-picker
  185. v-model="screenForm.approvaTime"
  186. type="datetimerange"
  187. range-separator="至"
  188. style="width: 100%"
  189. value-format="yyyy-MM-dd HH:mm:ss"
  190. start-placeholder="开始日期"
  191. end-placeholder="结束日期"
  192. >
  193. </el-date-picker>
  194. </el-form-item>
  195. </el-col>
  196. <el-col :xs="24" :sm="24" :lg="6" class="tr">
  197. <el-form-item label="">
  198. <el-button @click="resetScreenForm">清空</el-button>
  199. <el-button type="primary" @click="submitScreenForm"
  200. >搜索</el-button
  201. >
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. </el-form>
  206. </div>
  207. <div class="mymain-container">
  208. <div class="btn-group clearfix">
  209. <div class="fl">
  210. <el-button
  211. type="primary"
  212. size="mini"
  213. @click="toPrint"
  214. :disabled="tableSelection.length < 1"
  215. >打印发货单
  216. </el-button>
  217. <div class="num" v-if="totalNum">
  218. 当前列表总发货数量:{{ totalNum }}
  219. </div>
  220. </div>
  221. <!-- -->
  222. <div class="fr" style="display: flex">
  223. <el-button
  224. size="mini"
  225. type="primary"
  226. v-if="$checkBtnRole('refund', $route.meta.roles)"
  227. style="margin-right: 10px"
  228. icon="el-icon-plus"
  229. @click="$router.push('/supply/deliver/apply_list?isShow=true')"
  230. >零售退货申请</el-button
  231. >
  232. <el-button
  233. size="mini"
  234. type="primary"
  235. v-if="$checkBtnRole('refund', $route.meta.roles)"
  236. style="margin-right: 10px"
  237. icon="el-icon-plus"
  238. @click="$router.push('/supply/deliver/engin_list?isShow=true')"
  239. >工程退货申请</el-button
  240. >
  241. <ExportButton
  242. :exUrl="'invoice/exportInvoice'"
  243. :exParams="exParams"
  244. />
  245. </div>
  246. </div>
  247. <div class="table">
  248. <el-table
  249. ref="table"
  250. v-loading="listLoading"
  251. :data="dataList"
  252. element-loading-text="Loading"
  253. border
  254. fit
  255. highlight-current-row
  256. stripe
  257. @select="handleSelect"
  258. @select-all="handleSelectAll"
  259. show-summary
  260. :summary-method="$getSummaries"
  261. max-height="500"
  262. >
  263. <el-table-column
  264. align="center"
  265. type="selection"
  266. width="55"
  267. ></el-table-column>
  268. <el-table-column
  269. align="right"
  270. label="打印次数"
  271. sortable
  272. prop="printNum"
  273. min-width="100"
  274. show-overflow-tooltip
  275. >
  276. </el-table-column>
  277. <el-table-column
  278. align="left"
  279. label="订单类型"
  280. sortable
  281. prop="orderType"
  282. min-width="100"
  283. show-overflow-tooltip
  284. >
  285. <template slot-scope="scope">
  286. {{ scope.row.orderType | orderTypeFilter }}
  287. </template>
  288. </el-table-column>
  289. <el-table-column
  290. align="left"
  291. label="审核日期"
  292. sortable
  293. prop="approvalTime"
  294. min-width="160"
  295. show-overflow-tooltip
  296. >
  297. </el-table-column>
  298. <el-table-column
  299. align="left"
  300. label="发货日期"
  301. sortable
  302. prop="orderTime"
  303. min-width="160"
  304. show-overflow-tooltip
  305. >
  306. </el-table-column>
  307. <el-table-column
  308. align="left"
  309. label="订单日期"
  310. sortable
  311. prop="theTime"
  312. min-width="160"
  313. show-overflow-tooltip
  314. >
  315. </el-table-column>
  316. <el-table-column
  317. align="left"
  318. label="发货单号"
  319. sortable
  320. prop="id"
  321. min-width="130"
  322. show-overflow-tooltip
  323. >
  324. <template slot-scope="scope">
  325. <CopyButton :copyText="scope.row.id" />
  326. <span>{{ scope.row.id }}</span>
  327. </template>
  328. </el-table-column>
  329. <el-table-column
  330. align="left"
  331. label="订单号"
  332. sortable
  333. prop="orderId"
  334. min-width="140"
  335. show-overflow-tooltip
  336. >
  337. <template slot-scope="scope">
  338. <CopyButton
  339. :copyText="
  340. scope.row.enginOrderType == 'HOME' ||
  341. scope.row.enginOrderType == 'TRADE'
  342. ? scope.row.enginOrderNo
  343. : scope.row.mainOrderId
  344. "
  345. />
  346. <span>{{
  347. scope.row.enginOrderType == "HOME" ||
  348. scope.row.enginOrderType == "TRADE"
  349. ? scope.row.enginOrderNo
  350. : scope.row.mainOrderId
  351. }}</span>
  352. </template>
  353. </el-table-column>
  354. <el-table-column
  355. align="left"
  356. label="经销商编码"
  357. sortable
  358. prop="customerNumber"
  359. min-width="120"
  360. show-overflow-tooltip
  361. >
  362. <template slot-scope="scope">
  363. <CopyButton :copyText="scope.row.customerNumber" />
  364. <span>{{ scope.row.customerNumber }}</span>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. align="left"
  369. label="经销商名称"
  370. sortable
  371. prop="customerName"
  372. min-width="250"
  373. show-overflow-tooltip
  374. >
  375. <template slot-scope="scope">
  376. <CopyButton :copyText="scope.row.customerName" />
  377. <span>{{ scope.row.customerName }}</span>
  378. </template>
  379. </el-table-column>
  380. <el-table-column
  381. align="left"
  382. label="销售类型"
  383. sortable
  384. prop="saleTypeName"
  385. min-width="100"
  386. show-overflow-tooltip
  387. >
  388. </el-table-column>
  389. <el-table-column
  390. align="left"
  391. label="物料编码"
  392. sortable
  393. prop="materialCode"
  394. min-width="120"
  395. show-overflow-tooltip
  396. >
  397. <template slot-scope="scope">
  398. <CopyButton :copyText="scope.row.materialCode" />
  399. <span>{{ scope.row.materialCode }}</span>
  400. </template>
  401. </el-table-column>
  402. <el-table-column
  403. align="left"
  404. label="产品编码"
  405. sortable
  406. prop="materialOldNumber"
  407. min-width="140"
  408. show-overflow-tooltip
  409. >
  410. <template slot-scope="scope">
  411. <CopyButton :copyText="scope.row.materialOldNumber" />
  412. <span>{{ scope.row.materialOldNumber }}</span>
  413. </template>
  414. </el-table-column>
  415. <el-table-column
  416. align="left"
  417. label="产品名称"
  418. sortable
  419. prop="materialName"
  420. min-width="160"
  421. show-overflow-tooltip
  422. >
  423. <template slot-scope="scope">
  424. <CopyButton :copyText="scope.row.materialName" />
  425. <span>{{ scope.row.materialName }}</span>
  426. </template>
  427. </el-table-column>
  428. <el-table-column
  429. align="left"
  430. label="规格型号"
  431. sortable
  432. prop="specification"
  433. min-width="350"
  434. show-overflow-tooltip
  435. >
  436. <template slot-scope="scope">
  437. <CopyButton :copyText="scope.row.specification" />
  438. <span>{{ scope.row.specification }}</span>
  439. </template>
  440. </el-table-column>
  441. <el-table-column
  442. align="left"
  443. label="仓库"
  444. sortable
  445. prop="correspondName"
  446. min-width="100"
  447. show-overflow-tooltip
  448. >
  449. </el-table-column>
  450. <el-table-column
  451. align="right"
  452. label="未出库数量"
  453. sortable
  454. prop="compute_wckNum"
  455. min-width="120"
  456. show-overflow-tooltip
  457. >
  458. <template slot-scope="scope">
  459. {{
  460. comRefundableQty(
  461. scope.row.type,
  462. scope.row.salesExamineStatus,
  463. scope.row
  464. )
  465. }}
  466. </template>
  467. </el-table-column>
  468. <el-table-column
  469. align="right"
  470. label="发货数量"
  471. sortable
  472. prop="refundableQty"
  473. min-width="120"
  474. show-overflow-tooltip
  475. >
  476. </el-table-column>
  477. <el-table-column
  478. align="right"
  479. label="发货金额"
  480. sortable
  481. prop="payAmount"
  482. min-width="100"
  483. show-overflow-tooltip
  484. >
  485. <template slot-scope="scope">
  486. {{ scope.row.payAmount | numToFixed }}
  487. </template>
  488. </el-table-column>
  489. <el-table-column
  490. align="right"
  491. label="发货返利金额"
  492. sortable
  493. prop="payRebateAmount"
  494. min-width="130"
  495. show-overflow-tooltip
  496. >
  497. <template slot-scope="scope">
  498. {{ scope.row.payRebateAmount | numToFixed }}
  499. </template>
  500. </el-table-column>
  501. <el-table-column
  502. align="right"
  503. label="发货折扣金额"
  504. sortable
  505. prop="totalDiscAmount"
  506. min-width="130"
  507. show-overflow-tooltip
  508. >
  509. <template slot-scope="scope">
  510. {{ scope.row.totalDiscAmount | numToFixed }}
  511. </template>
  512. </el-table-column>
  513. <el-table-column
  514. align="right"
  515. label="折扣额合计"
  516. sortable
  517. prop="compute_zkeAmount"
  518. min-width="120"
  519. show-overflow-tooltip
  520. >
  521. <template slot-scope="scope">
  522. {{
  523. (scope.row.totalDiscAmount + scope.row.payRebateAmount)
  524. | numToFixed
  525. }}
  526. </template>
  527. </el-table-column>
  528. <el-table-column
  529. align="right"
  530. label="含税单价"
  531. sortable
  532. prop="singlePayPrice"
  533. min-width="100"
  534. show-overflow-tooltip
  535. >
  536. <template slot-scope="scope">
  537. {{ scope.row.singlePayPrice | numToFixed }}
  538. </template>
  539. </el-table-column>
  540. <el-table-column
  541. align="right"
  542. label="含税总额"
  543. sortable
  544. prop="payAmount"
  545. min-width="100"
  546. show-overflow-tooltip
  547. >
  548. <template slot-scope="scope">
  549. {{ scope.row.payAmount | numToFixed }}
  550. </template>
  551. </el-table-column>
  552. <el-table-column
  553. align="left"
  554. label="表头业务员"
  555. sortable
  556. prop="k3ServiceName"
  557. min-width="120"
  558. show-overflow-tooltip
  559. >
  560. </el-table-column>
  561. <el-table-column
  562. align="left"
  563. label="表体业务员"
  564. sortable
  565. prop="serviceName"
  566. min-width="120"
  567. show-overflow-tooltip
  568. >
  569. </el-table-column>
  570. <el-table-column
  571. align="left"
  572. label="政策单号"
  573. sortable
  574. prop="policyCode"
  575. min-width="100"
  576. show-overflow-tooltip
  577. >
  578. </el-table-column>
  579. <el-table-column
  580. align="left"
  581. label="政策名称"
  582. sortable
  583. prop="policyTitle"
  584. min-width="100"
  585. show-overflow-tooltip
  586. >
  587. </el-table-column>
  588. <el-table-column
  589. align="left"
  590. label="区域"
  591. sortable
  592. prop="adminArea"
  593. min-width="100"
  594. show-overflow-tooltip
  595. >
  596. </el-table-column>
  597. <el-table-column
  598. align="left"
  599. label="业务区域"
  600. sortable
  601. prop="serviceArea"
  602. min-width="100"
  603. show-overflow-tooltip
  604. >
  605. </el-table-column>
  606. <el-table-column
  607. align="left"
  608. label="月份"
  609. sortable
  610. prop="month"
  611. min-width="100"
  612. show-overflow-tooltip
  613. >
  614. </el-table-column>
  615. <el-table-column
  616. align="left"
  617. label="项目编码"
  618. sortable
  619. prop="refEnginRecordNo"
  620. min-width="160"
  621. show-overflow-tooltip
  622. >
  623. </el-table-column>
  624. <el-table-column
  625. align="left"
  626. label="项目名称"
  627. sortable
  628. prop="refProjectName"
  629. min-width="160"
  630. show-overflow-tooltip
  631. >
  632. </el-table-column>
  633. <el-table-column
  634. align="left"
  635. label="存货类别"
  636. sortable
  637. prop="categoryName"
  638. min-width="160"
  639. show-overflow-tooltip
  640. >
  641. </el-table-column>
  642. <el-table-column
  643. align="left"
  644. label="申请发货单备注"
  645. sortable
  646. prop="remark"
  647. min-width="200"
  648. show-overflow-tooltip
  649. >
  650. </el-table-column>
  651. <el-table-column
  652. align="left"
  653. label="表头备注"
  654. sortable
  655. prop="headerRemark"
  656. min-width="200"
  657. show-overflow-tooltip
  658. >
  659. </el-table-column>
  660. <el-table-column
  661. align="left"
  662. label="表体备注"
  663. sortable
  664. prop="invoiceRemark"
  665. min-width="200"
  666. show-overflow-tooltip
  667. >
  668. </el-table-column>
  669. <el-table-column
  670. align="left"
  671. label="打印次数"
  672. sortable
  673. prop="printNum"
  674. min-width="100"
  675. show-overflow-tooltip
  676. >
  677. </el-table-column>
  678. <el-table-column
  679. align="left"
  680. label="经销商现金钱包"
  681. sortable
  682. prop="customerWalletName"
  683. min-width="140"
  684. show-overflow-tooltip
  685. ></el-table-column>
  686. <el-table-column
  687. align="left"
  688. label="经销商返利钱包"
  689. sortable
  690. prop="customerWalletName2"
  691. min-width="140"
  692. show-overflow-tooltip
  693. ></el-table-column>
  694. <el-table-column
  695. align="left"
  696. label="文件编号"
  697. sortable
  698. prop="itemFileNo"
  699. min-width="100"
  700. show-overflow-tooltip
  701. >
  702. </el-table-column>
  703. <el-table-column
  704. align="left"
  705. label="预约提货打印状态"
  706. sortable
  707. prop="printStatus"
  708. min-width="150"
  709. show-overflow-tooltip
  710. >
  711. <template slot-scope="scope">
  712. {{ scope.row.printStatus == 1 ? `打印` : ` 未打印` }}
  713. </template>
  714. </el-table-column>
  715. <el-table-column
  716. align="left"
  717. label="二级经销商代码"
  718. sortable
  719. prop="secondCustomerNumber"
  720. min-width="150"
  721. show-overflow-tooltip
  722. >
  723. </el-table-column>
  724. </el-table>
  725. </div>
  726. </div>
  727. <div class="pagination clearfix">
  728. <div class="fr">
  729. <el-pagination
  730. @size-change="handleSizeChange"
  731. @current-change="handleCurrentChange"
  732. :current-page="currentPage"
  733. :page-sizes="[10, 20, 50, 100, 500, 1000, 2000]"
  734. :page-size="10"
  735. layout="total, sizes, prev, pager, next, jumper"
  736. :total="listTotal"
  737. >
  738. </el-pagination>
  739. </div>
  740. </div>
  741. </div>
  742. <print-preview ref="preView" />
  743. <el-dialog
  744. title="密码确认"
  745. :visible.sync="isShowDialog"
  746. :show-close="false"
  747. width="40%"
  748. :close-on-click-modal="false"
  749. >
  750. <el-form
  751. ref="dialogForm"
  752. :model="dialogForm"
  753. :rules="dialogFormRules"
  754. label-position="right"
  755. label-width="70px"
  756. >
  757. <el-row :gutter="20">
  758. <el-col :xs="24" :sm="24" :lg="24">
  759. <el-form-item label="密码" prop="password">
  760. <el-input
  761. v-model="dialogForm.password"
  762. autocomplete="off"
  763. placeholder="请输入密码"
  764. ></el-input>
  765. </el-form-item>
  766. </el-col>
  767. <el-col :xs="24" :sm="12" :lg="12">
  768. <el-form-item label="操作人" prop="createMan">
  769. <el-input v-model="dialogForm.createMan" readonly></el-input>
  770. </el-form-item>
  771. </el-col>
  772. <el-col :xs="24" :sm="12" :lg="12" style="height: 51px">
  773. <el-form-item label="操作日期" prop="createDate">
  774. <el-date-picker
  775. v-model="dialogForm.createDate"
  776. readonly
  777. type="date"
  778. value-format="yyyy-MM-dd"
  779. style="width: 100%"
  780. placeholder="选择日期"
  781. >
  782. </el-date-picker>
  783. </el-form-item>
  784. </el-col>
  785. </el-row>
  786. </el-form>
  787. <div slot="footer" class="dialog-footer">
  788. <el-button @click="cancelDialogForm">取 消</el-button>
  789. <el-button type="primary" @click="submitDialogForm">确 定</el-button>
  790. </div>
  791. </el-dialog>
  792. </div>
  793. </template>
  794. <script>
  795. import { getSumList } from "@/api/supply/deliver";
  796. import print from "@/mixin/print";
  797. import { checkPassword, getListInvoiceNumber } from "@/api/supply/pickup";
  798. import { getCategoryList, getSalesmanList } from "@/api/common";
  799. import SumPrint from "@/views/supply/deliver/components/sum_print";
  800. import { getWarehouseList } from "@/api/supply/apply";
  801. import printPreview from "./components/design/preview.vue";
  802. export default {
  803. components: {
  804. SumPrint,
  805. printPreview,
  806. },
  807. mixins: [print],
  808. filters: {
  809. orderTypeFilter(val) {
  810. const MAP = {
  811. HOME: "家用单",
  812. TRADE: "商用单",
  813. RETAIL: "零售单",
  814. RETAIL_POLICY: "销售政策单",
  815. PERMU_HOME: "置换家用单",
  816. PERMU_TRADE: "置换商用单",
  817. PERMU_RETAIL: "置换零售单",
  818. PERMU_RETAIL_POLICY: "置换销售政策单",
  819. REQUISITION_HOME: "调拨家用单",
  820. REQUISITION_TRADE: "调拨商用单",
  821. REQUISITION_RETAIL: "调拨零售单",
  822. REQUISITION_RETAIL_POLICY: "调拨销售政策单",
  823. };
  824. return MAP[val];
  825. },
  826. },
  827. data() {
  828. return {
  829. currentPage: 1, // 当前页码
  830. pageSize: 10, // 每页数量
  831. listTotal: 0, // 列表总数
  832. dataList: null, // 列表数据
  833. listLoading: false, // 列表加载loading
  834. screenForm: {
  835. // 筛选表单数据
  836. goodsName: "",
  837. goodsCode: "",
  838. goodsOldCode: "",
  839. model: "",
  840. createDate: "",
  841. deliverDate: "",
  842. correspondId: [],
  843. jxsNum: "",
  844. jxsName: "",
  845. orderNum: "",
  846. type: "",
  847. salesMan: "",
  848. k3ServiceId: "",
  849. mainOrderId: "",
  850. approvaTime: "",
  851. },
  852. categoryList: [],
  853. salesmanList: [],
  854. tableSelection: [],
  855. queryItem: {},
  856. isShowPrint: false,
  857. totalNum: 0,
  858. isShowDialog: false,
  859. dialogForm: {
  860. password: "",
  861. createMan: "",
  862. createDate: "",
  863. },
  864. warehouseList: [],
  865. dialogFormRules: {
  866. password: [{ required: true, message: "请输入密码", trigger: "blur" }],
  867. },
  868. };
  869. },
  870. computed: {
  871. exParams() {
  872. return {
  873. materialName: this.screenForm.goodsName,
  874. materialNumber: this.screenForm.goodsCode,
  875. materialOldNumber: this.screenForm.goodsOldCode,
  876. specification: this.screenForm.model,
  877. createStartTime: this.screenForm.createDate
  878. ? this.screenForm.createDate[0]
  879. : "",
  880. createEndTime: this.screenForm.createDate
  881. ? this.screenForm.createDate[1]
  882. : "",
  883. startTime: this.screenForm.deliverDate
  884. ? this.screenForm.deliverDate[0]
  885. : "",
  886. endTime: this.screenForm.deliverDate
  887. ? this.screenForm.deliverDate[1]
  888. : "",
  889. customerNumber: this.screenForm.jxsNum,
  890. customerName: this.screenForm.jxsName,
  891. id: this.screenForm.orderNum,
  892. categoryName: this.screenForm.type,
  893. serviceId: this.screenForm.salesMan,
  894. k3ServiceId: this.screenForm.k3ServiceId,
  895. mainOrderId: this.screenForm.mainOrderId,
  896. approvalEndTime: this.screenForm.approvaTime
  897. ? this.screenForm.approvaTime[1]
  898. : "",
  899. approvalStartTime: this.screenForm.approvaTime
  900. ? this.screenForm.approvaTime[0]
  901. : "",
  902. correspondId: this.screenForm.correspondId.join(","),
  903. };
  904. },
  905. comRefundableQty() {
  906. return (type, status, row) => {
  907. if (type == 2) {
  908. return "";
  909. } else {
  910. if (status == "OK") {
  911. return 0;
  912. } else {
  913. return row.refundableQty;
  914. }
  915. }
  916. };
  917. },
  918. },
  919. watch: {
  920. dataList: {
  921. handler(newValue, oldValue) {
  922. if (newValue && newValue.length) {
  923. newValue.forEach((item, index) => {
  924. this.dataList[index].compute_zkeAmount =
  925. item.totalDiscAmount + item.payRebateAmount;
  926. this.dataList[index].compute_wckNum = this.comRefundableQty(
  927. item.type,
  928. item.salesExamineStatus,
  929. item
  930. );
  931. });
  932. }
  933. },
  934. immediate: true,
  935. deep: true,
  936. },
  937. },
  938. created() {
  939. this.getSalesmanList();
  940. this.getCategoryList();
  941. this.getList();
  942. this.getWarehouseList();
  943. },
  944. mounted() {
  945. this.initPrint();
  946. },
  947. methods: {
  948. // 获取业务员列表
  949. getSalesmanList() {
  950. getSalesmanList({
  951. pageNum: 1,
  952. pageSize: -1,
  953. isCustomer: 0,
  954. status: true,
  955. }).then((res) => {
  956. this.salesmanList = res.data.records;
  957. });
  958. },
  959. // 获取存货类别列表
  960. getCategoryList() {
  961. getCategoryList({
  962. pageNum: 1,
  963. pageSize: -1,
  964. }).then((res) => {
  965. this.categoryList = res.data.records;
  966. });
  967. },
  968. // 获取仓库列表
  969. getWarehouseList() {
  970. getWarehouseList({
  971. pageNum: 1,
  972. pageSize: -1,
  973. }).then((res) => {
  974. this.warehouseList = res.data.records;
  975. });
  976. },
  977. // 查询列表
  978. getList() {
  979. this.listLoading = true;
  980. let params = {
  981. pageNum: this.currentPage,
  982. pageSize: this.pageSize,
  983. materialName: this.screenForm.goodsName,
  984. materialNumber: this.screenForm.goodsCode,
  985. materialOldNumber: this.screenForm.goodsOldCode,
  986. specification: this.screenForm.model,
  987. createStartTime: this.screenForm.createDate
  988. ? this.screenForm.createDate[0]
  989. : "",
  990. createEndTime: this.screenForm.createDate
  991. ? this.screenForm.createDate[1]
  992. : "",
  993. startTime: this.screenForm.deliverDate
  994. ? this.screenForm.deliverDate[0]
  995. : "",
  996. endTime: this.screenForm.deliverDate
  997. ? this.screenForm.deliverDate[1]
  998. : "",
  999. customerNumber: this.screenForm.jxsNum,
  1000. customerName: this.screenForm.jxsName,
  1001. id: this.screenForm.orderNum,
  1002. categoryName: this.screenForm.type,
  1003. serviceId: this.screenForm.salesMan,
  1004. k3ServiceId: this.screenForm.k3ServiceId,
  1005. mainOrderId: this.screenForm.mainOrderId,
  1006. approvalEndTime: this.screenForm.approvaTime
  1007. ? this.screenForm.approvaTime[1]
  1008. : "",
  1009. approvalStartTime: this.screenForm.approvaTime
  1010. ? this.screenForm.approvaTime[0]
  1011. : "",
  1012. correspondId: this.screenForm.correspondId.join(","),
  1013. };
  1014. getSumList(params).then((res) => {
  1015. res.data.records.forEach((item) => {
  1016. item.notOutNumber = item.salesStatus ? 0 : item.refundableQty;
  1017. item.sums1 = ["refundableQty", "compute_wckNum"];
  1018. item.sums2 = [
  1019. "payAmount",
  1020. "payRebateAmount",
  1021. "discAmount",
  1022. "totalDiscAmount",
  1023. "singlePayPrice",
  1024. "compute_zkeAmount",
  1025. ];
  1026. });
  1027. this.dataList = res.data.records;
  1028. this.listTotal = res.data.total;
  1029. this.listLoading = false;
  1030. });
  1031. this.getListInvoiceNumber();
  1032. },
  1033. getListInvoiceNumber() {
  1034. let params = {
  1035. materialName: this.screenForm.goodsName,
  1036. materialNumber: this.screenForm.goodsCode,
  1037. materialOldNumber: this.screenForm.goodsOldCode,
  1038. specification: this.screenForm.model,
  1039. createStartTime: this.screenForm.createDate
  1040. ? this.screenForm.createDate[0]
  1041. : "",
  1042. createEndTime: this.screenForm.createDate
  1043. ? this.screenForm.createDate[1]
  1044. : "",
  1045. startTime: this.screenForm.deliverDate
  1046. ? this.screenForm.deliverDate[0]
  1047. : "",
  1048. endTime: this.screenForm.deliverDate
  1049. ? this.screenForm.deliverDate[1]
  1050. : "",
  1051. customerNumber: this.screenForm.jxsNum,
  1052. customerName: this.screenForm.jxsName,
  1053. id: this.screenForm.orderNum,
  1054. categoryName: this.screenForm.type,
  1055. serviceId: this.screenForm.salesMan,
  1056. k3ServiceId: this.screenForm.k3ServiceId,
  1057. mainOrderId: this.screenForm.mainOrderId,
  1058. approvalEndTime: this.screenForm.approvaTime
  1059. ? this.screenForm.approvaTime[1]
  1060. : "",
  1061. approvalStartTime: this.screenForm.approvaTime
  1062. ? this.screenForm.approvaTime[0]
  1063. : "",
  1064. correspondId: this.screenForm.correspondId.join(","),
  1065. };
  1066. getListInvoiceNumber(params).then((res) => {
  1067. // console.log(res,'ii');
  1068. this.totalNum = res.data;
  1069. });
  1070. },
  1071. // 提交筛选表单
  1072. submitScreenForm() {
  1073. this.currentPage = 1;
  1074. this.getList();
  1075. },
  1076. // 重置筛选表单
  1077. resetScreenForm() {
  1078. this.$refs.screenForm.resetFields();
  1079. this.currentPage = 1;
  1080. this.getList();
  1081. },
  1082. // 更改每页数量
  1083. handleSizeChange(val) {
  1084. this.pageSize = val;
  1085. this.currentPage = 1;
  1086. this.getList();
  1087. },
  1088. // 更改当前页
  1089. handleCurrentChange(val) {
  1090. this.currentPage = val;
  1091. this.getList();
  1092. },
  1093. handleSelect(selection, row) {
  1094. this.$refs.table.toggleRowSelection(row);
  1095. this.dataList.forEach((item) => {
  1096. if (item.id === row.id) {
  1097. this.$refs.table.toggleRowSelection(item);
  1098. }
  1099. });
  1100. this.tableSelection = this.$refs.table.selection;
  1101. },
  1102. handleSelectAll(selection) {
  1103. this.tableSelection = this.$refs.table.selection;
  1104. },
  1105. // 点击打印
  1106. toPrint() {
  1107. this.queryItem = this.tableSelection;
  1108. if (!this.tableSelection[0].printNum) {
  1109. this.queryItem = this.tableSelection;
  1110. this.getDateil(this.tableSelection, "getDeliverDetail");
  1111. this.$refs.preView.show(this.hiprintTemplate, this.outputData);
  1112. } else {
  1113. this.queryItem = this.tableSelection;
  1114. this.dialogForm.createMan = JSON.parse(
  1115. localStorage.getItem("supply_user")
  1116. ).nickName;
  1117. this.dialogForm.createDate = this.getDate();
  1118. this.isShowDialog = true;
  1119. }
  1120. },
  1121. // 关闭弹窗
  1122. cancelDialogForm() {
  1123. this.isShowDialog = false;
  1124. this.$refs.dialogForm.resetFields();
  1125. },
  1126. // 提交 弹窗
  1127. submitDialogForm() {
  1128. this.$refs.dialogForm.validate((valid) => {
  1129. if (valid) {
  1130. let params = {
  1131. shipId: this.queryItem[0].invoiceId,
  1132. password: this.dialogForm.password,
  1133. };
  1134. checkPassword(params).then((res) => {
  1135. this.cancelDialogForm();
  1136. this.getDateil(this.tableSelection, "getDeliverDetail");
  1137. this.$refs.preView.show(this.hiprintTemplate, this.outputData);
  1138. });
  1139. }
  1140. });
  1141. },
  1142. getDate() {
  1143. var date = new Date();
  1144. var seperator1 = "-";
  1145. var year = date.getFullYear();
  1146. var month = date.getMonth() + 1;
  1147. var strDate = date.getDate();
  1148. if (month >= 1 && month <= 9) {
  1149. month = "0" + month;
  1150. }
  1151. if (strDate >= 0 && strDate <= 9) {
  1152. strDate = "0" + strDate;
  1153. }
  1154. var currentdate = year + seperator1 + month + seperator1 + strDate;
  1155. return currentdate;
  1156. },
  1157. backList() {
  1158. this.queryItem = {};
  1159. this.isShowPrint = false;
  1160. },
  1161. },
  1162. };
  1163. </script>
  1164. <style lang="scss" scoped>
  1165. .num {
  1166. display: inline-block;
  1167. font-size: 16px;
  1168. margin-left: 20px;
  1169. color: #909399;
  1170. vertical-align: middle;
  1171. }
  1172. </style>