new_engin.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  1. <template>
  2. <div class="app-container">
  3. <div
  4. v-show="
  5. !isShowDetail && !isShowExamine && !isShowForm && !isShowReturnForm
  6. "
  7. >
  8. <!-- 筛选条件 -->
  9. <div class="screen-container">
  10. <el-form
  11. ref="screenForm"
  12. :model="screenForm"
  13. label-width="100px"
  14. size="mini"
  15. label-position="left"
  16. >
  17. <el-row :gutter="20">
  18. <el-col :xs="24" :sm="24" :lg="24">
  19. <el-form-item prop="status" label-width="0">
  20. <el-radio-group v-model="screenForm.status" @change="getList()">
  21. <el-radio-button label="">全部</el-radio-button>
  22. <el-radio-button
  23. v-for="(item, index) in statusList"
  24. :key="index"
  25. :label="item.value"
  26. >{{ item.label }}</el-radio-button
  27. >
  28. </el-radio-group>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :xs="24" :sm="12" :lg="6">
  32. <el-form-item label="发货申请单" prop="orderNum">
  33. <el-input
  34. v-model="screenForm.orderNum"
  35. placeholder="请输入发货申请单"
  36. />
  37. </el-form-item>
  38. </el-col>
  39. <el-col :xs="24" :sm="12" :lg="6">
  40. <el-form-item label="仓库名称" prop="warehouse">
  41. <el-input
  42. v-model="screenForm.warehouse"
  43. placeholder="请输入仓库名称"
  44. />
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :lg="6">
  48. <el-form-item label="经销商编码" prop="jxsNum">
  49. <el-input
  50. v-model="screenForm.jxsNum"
  51. placeholder="请输入经销商编码"
  52. />
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="12" :lg="6">
  56. <el-form-item label="经销商名称" prop="jxsName">
  57. <el-input
  58. v-model="screenForm.jxsName"
  59. placeholder="请输入经销商名称"
  60. />
  61. </el-form-item>
  62. </el-col>
  63. <el-col :xs="24" :sm="12" :lg="6">
  64. <el-form-item label="发货申请日期" prop="date">
  65. <el-date-picker
  66. v-model="screenForm.date"
  67. type="datetimerange"
  68. range-separator="至"
  69. style="width: 100%"
  70. value-format="yyyy-MM-dd HH:mm:ss"
  71. start-placeholder="开始日期"
  72. end-placeholder="结束日期"
  73. />
  74. </el-form-item>
  75. </el-col>
  76. <el-col :xs="24" :sm="12" :lg="6">
  77. <el-form-item label="产品名称" prop="chName">
  78. <el-input
  79. v-model="screenForm.chName"
  80. placeholder="请输入产品名称"
  81. />
  82. </el-form-item>
  83. </el-col>
  84. <el-col :xs="24" :sm="12" :lg="6">
  85. <el-form-item label="规格型号" prop="model">
  86. <el-input
  87. v-model="screenForm.model"
  88. placeholder="请输入规格型号"
  89. />
  90. </el-form-item>
  91. </el-col>
  92. <el-col :xs="24" :sm="12" :lg="6">
  93. <el-form-item label="订单类型" prop="orderType">
  94. <el-select
  95. v-model="screenForm.orderType"
  96. placeholder="请选择"
  97. clearable
  98. >
  99. <el-option
  100. v-for="item in orderTypeList"
  101. :key="item.value"
  102. :label="item.label"
  103. :value="item.value"
  104. />
  105. </el-select>
  106. </el-form-item>
  107. </el-col>
  108. <el-col :xs="24" :sm="12" :lg="6">
  109. <el-form-item label="订单号" prop="mainOrderId">
  110. <el-input
  111. v-model="screenForm.mainOrderId"
  112. placeholder="请输入订单号"
  113. />
  114. </el-form-item>
  115. </el-col>
  116. <el-col :xs="24" :sm="12" :lg="6">
  117. <el-form-item label="工程登录编号" prop="refEnginRecordNo">
  118. <el-input
  119. v-model="screenForm.refEnginRecordNo"
  120. placeholder="请输入工程登录编号"
  121. />
  122. </el-form-item>
  123. </el-col>
  124. <el-col :xs="24" :sm="12" :lg="6">
  125. <el-form-item label="使用单位" prop="refUseUnit">
  126. <el-input
  127. v-model="screenForm.refUseUnit"
  128. placeholder="请输入使用单位"
  129. />
  130. </el-form-item>
  131. </el-col>
  132. <el-col :xs="24" :sm="12" :lg="6">
  133. <el-form-item label="表头业务员" prop="k3ServiceId">
  134. <el-select
  135. v-model="screenForm.k3ServiceId"
  136. placeholder="选择表头业务员"
  137. clearable
  138. filterable
  139. style="width: 100%"
  140. >
  141. <el-option
  142. v-for="item in salesmanList"
  143. :key="item.adminUserId"
  144. :label="item.nickName"
  145. :value="item.adminUserId"
  146. />
  147. </el-select>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :xs="24" :sm="12" :lg="6">
  151. <el-form-item label="表体业务员" prop="salesMan">
  152. <el-select
  153. v-model="screenForm.salesMan"
  154. placeholder="选择表体业务员"
  155. clearable
  156. filterable
  157. style="width: 100%"
  158. >
  159. <el-option
  160. v-for="item in salesmanList"
  161. :key="item.adminUserId"
  162. :label="item.nickName"
  163. :value="item.adminUserId"
  164. />
  165. </el-select>
  166. </el-form-item>
  167. </el-col>
  168. <el-col :xs="24" :sm="12" :lg="6">
  169. <el-form-item label="产品类别">
  170. <el-select
  171. v-model="screenForm.categoryId"
  172. style="width: 100%"
  173. placeholder="选择产品类别"
  174. filterable
  175. clearable
  176. >
  177. <el-option
  178. v-for="item in categoryList"
  179. :key="item.name"
  180. :label="item.name"
  181. :value="item.id"
  182. />
  183. </el-select>
  184. </el-form-item>
  185. </el-col>
  186. <el-col :xs="24" :sm="12" :lg="6">
  187. <el-form-item label="审核人" prop="approvalName">
  188. <el-input
  189. v-model="screenForm.approvalName"
  190. placeholder="请输入审核人"
  191. />
  192. </el-form-item>
  193. </el-col>
  194. <el-col :xs="24" :sm="12" :lg="6">
  195. <el-form-item label="区域" prop="refRegionWork">
  196. <el-input
  197. v-model="screenForm.refRegionWork"
  198. placeholder="请输入区域"
  199. />
  200. </el-form-item>
  201. </el-col>
  202. <el-col :xs="24" :sm="12" :lg="6">
  203. <el-form-item label="制单人" prop="createBy">
  204. <el-input
  205. v-model="screenForm.createBy"
  206. placeholder="请输入制单人"
  207. />
  208. </el-form-item>
  209. </el-col>
  210. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  211. <el-form-item label="">
  212. <el-button @click="resetScreenForm">清空</el-button>
  213. <el-button type="primary" @click="submitScreenForm"
  214. >搜索</el-button
  215. >
  216. </el-form-item>
  217. </el-col>
  218. </el-row>
  219. </el-form>
  220. </div>
  221. <div class="mymain-container">
  222. <div class="btn-group clearfix">
  223. <div class="fl">
  224. <el-button
  225. v-if="$checkBtnRole('add', $route.meta.roles)"
  226. size="mini"
  227. type="primary"
  228. icon="el-icon-plus"
  229. @click="toForm()"
  230. >发货申请</el-button
  231. >
  232. <el-button
  233. v-if="$checkBtnRole('refund', $route.meta.roles)"
  234. size="mini"
  235. type="primary"
  236. icon="el-icon-plus"
  237. @click="toReturnForm()"
  238. >退货申请</el-button
  239. >
  240. <el-button
  241. v-if="$checkBtnRole('examine', $route.meta.roles)"
  242. size="mini"
  243. type="warning"
  244. icon="el-icon-finished"
  245. :disabled="multipleSelection.length < 1"
  246. @click="batchExamine"
  247. >批量审批</el-button
  248. >
  249. </div>
  250. <div class="fr">
  251. <ExportButton
  252. :ex-url="'invoice/listProjectExport'"
  253. :ex-params="exParams"
  254. />
  255. </div>
  256. </div>
  257. <div class="table">
  258. <el-table
  259. v-loading="listLoading"
  260. :data="dataList"
  261. element-loading-text="Loading"
  262. border
  263. fit
  264. :row-style="rowClass"
  265. show-summary
  266. :summary-method="$getSummaries"
  267. @selection-change="handleSelectionChange"
  268. >
  269. <!-- :selectable="selectable"-->
  270. <el-table-column
  271. align="center"
  272. type="selection"
  273. width="55"
  274. fixed="left"
  275. />
  276. <el-table-column
  277. align="left"
  278. label="订单类型"
  279. prop="type"
  280. min-width="100"
  281. show-overflow-tooltip
  282. >
  283. <template slot-scope="scope">
  284. {{ scope.row.type | orderTypeFilter }}
  285. </template>
  286. </el-table-column>
  287. <el-table-column
  288. align="left"
  289. label="发货申请单"
  290. prop="id"
  291. min-width="130"
  292. show-overflow-tooltip
  293. >
  294. <template slot-scope="scope">
  295. <CopyButton :copy-text="scope.row.id" />
  296. <span>{{ scope.row.id }}</span>
  297. </template>
  298. </el-table-column>
  299. <el-table-column
  300. align="left"
  301. label="发货申请日期"
  302. prop="createTime"
  303. min-width="160"
  304. show-overflow-tooltip
  305. />
  306. <el-table-column
  307. align="left"
  308. label="仓库"
  309. prop="correspondName"
  310. min-width="100"
  311. show-overflow-tooltip
  312. >
  313. <template slot-scope="scope">
  314. {{
  315. scope.row.type === 3
  316. ? scope.row.stockName
  317. : scope.row.correspondName
  318. }}
  319. </template>
  320. </el-table-column>
  321. <el-table-column
  322. align="left"
  323. label="订单号"
  324. prop="enginOrderNo"
  325. min-width="140"
  326. show-overflow-tooltip
  327. >
  328. <template slot-scope="scope">
  329. <CopyButton :copy-text="scope.row.enginOrderNo" />
  330. <span>{{ scope.row.enginOrderNo }}</span>
  331. </template>
  332. </el-table-column>
  333. <el-table-column
  334. align="left"
  335. label="工程登录编号"
  336. prop="refEnginRecordNo"
  337. min-width="200"
  338. show-overflow-tooltip
  339. >
  340. <template slot-scope="scope">
  341. <CopyButton :copy-text="scope.row.refEnginRecordNo" />
  342. <span>{{ scope.row.refEnginRecordNo }}</span>
  343. </template>
  344. </el-table-column>
  345. <el-table-column
  346. align="left"
  347. label="项目名称"
  348. prop="refProjectName"
  349. min-width="120"
  350. show-overflow-tooltip
  351. />
  352. <el-table-column
  353. align="left"
  354. label="项目类别"
  355. prop="refProjectCategory"
  356. min-width="120"
  357. show-overflow-tooltip
  358. />
  359. <el-table-column
  360. align="left"
  361. label="使用单位"
  362. prop="refUseUnit"
  363. min-width="120"
  364. show-overflow-tooltip
  365. />
  366. <el-table-column
  367. align="left"
  368. label="经销商编码"
  369. prop="customerNumber"
  370. min-width="100"
  371. show-overflow-tooltip
  372. >
  373. <template slot-scope="scope">
  374. <CopyButton :copy-text="scope.row.customerNumber" />
  375. <span>{{ scope.row.customerNumber }}</span>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. align="left"
  380. label="经销商名称"
  381. prop="customerName"
  382. min-width="250"
  383. show-overflow-tooltip
  384. >
  385. <template slot-scope="scope">
  386. <CopyButton :copy-text="scope.row.customerName" />
  387. <span>{{ scope.row.customerName }}</span>
  388. </template>
  389. </el-table-column>
  390. <el-table-column
  391. align="left"
  392. label="物料编码"
  393. prop="materialCode"
  394. min-width="120"
  395. show-overflow-tooltip
  396. >
  397. <template slot-scope="scope">
  398. <CopyButton :copy-text="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. prop="materialOldNumber"
  406. min-width="140"
  407. show-overflow-tooltip
  408. >
  409. <template slot-scope="scope">
  410. <CopyButton :copy-text="scope.row.materialOldNumber" />
  411. <span>{{ scope.row.materialOldNumber }}</span>
  412. </template>
  413. </el-table-column>
  414. <el-table-column
  415. align="left"
  416. label="产品名称"
  417. prop="materialName"
  418. min-width="160"
  419. show-overflow-tooltip
  420. >
  421. <template slot-scope="scope">
  422. <CopyButton :copy-text="scope.row.materialName" />
  423. <span>{{ scope.row.materialName }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column
  427. align="left"
  428. label="规格型号"
  429. prop="specification"
  430. min-width="350"
  431. show-overflow-tooltip
  432. >
  433. <template slot-scope="scope">
  434. <CopyButton :copy-text="scope.row.specification" />
  435. <span>{{ scope.row.specification }}</span>
  436. </template>
  437. </el-table-column>
  438. <el-table-column
  439. align="left"
  440. label="产品类别"
  441. prop="categoryName"
  442. min-width="100"
  443. show-overflow-tooltip
  444. >
  445. <template slot-scope="scope">
  446. <span>{{ scope.row.categoryName }}</span>
  447. </template>
  448. </el-table-column>
  449. <el-table-column
  450. align="left"
  451. label="单位"
  452. prop="unit"
  453. min-width="100"
  454. show-overflow-tooltip
  455. />
  456. <el-table-column
  457. align="left"
  458. label="文件编号"
  459. prop="itemFileNo"
  460. min-width="100"
  461. show-overflow-tooltip
  462. />
  463. <el-table-column
  464. align="right"
  465. label="数量"
  466. prop="refundableQty"
  467. min-width="100"
  468. show-overflow-tooltip
  469. />
  470. <el-table-column
  471. align="right"
  472. label="含税单价"
  473. prop="singlePayPrice"
  474. min-width="100"
  475. show-overflow-tooltip
  476. >
  477. <template slot-scope="scope">
  478. {{ scope.row.singlePayPrice | numToFixed }}
  479. </template>
  480. </el-table-column>
  481. <el-table-column
  482. align="right"
  483. label="价税合计"
  484. prop="payAmount"
  485. min-width="100"
  486. show-overflow-tooltip
  487. >
  488. <template slot-scope="scope">
  489. {{ scope.row.payAmount | numToFixed }}
  490. </template>
  491. </el-table-column>
  492. <el-table-column
  493. align="right"
  494. label="返利金额"
  495. prop="payRebateAmount"
  496. min-width="100"
  497. show-overflow-tooltip
  498. >
  499. <template slot-scope="scope">
  500. {{ scope.row.payRebateAmount | numToFixed }}
  501. </template>
  502. </el-table-column>
  503. <el-table-column
  504. align="right"
  505. label="格力折扣"
  506. prop="totalDiscAmount"
  507. min-width="100"
  508. show-overflow-tooltip
  509. >
  510. <template slot-scope="scope">
  511. {{ scope.row.totalDiscAmount | numToFixed }}
  512. </template>
  513. </el-table-column>
  514. <el-table-column
  515. align="left"
  516. label="订单备注"
  517. prop="headerRemark"
  518. min-width="160"
  519. show-overflow-tooltip
  520. />
  521. <el-table-column
  522. align="left"
  523. label="发货申请备注"
  524. prop="remark"
  525. min-width="160"
  526. show-overflow-tooltip
  527. />
  528. <el-table-column
  529. align="left"
  530. label="表体备注"
  531. prop="invoiceRemark"
  532. min-width="160"
  533. show-overflow-tooltip
  534. />
  535. <el-table-column
  536. align="left"
  537. label="业务员"
  538. prop="serviceName"
  539. min-width="100"
  540. show-overflow-tooltip
  541. />
  542. <el-table-column
  543. align="left"
  544. label="表头业务员"
  545. prop="k3ServiceName"
  546. min-width="100"
  547. show-overflow-tooltip
  548. />
  549. <el-table-column
  550. align="left"
  551. label="制单人"
  552. prop="createBy"
  553. min-width="100"
  554. show-overflow-tooltip
  555. />
  556. <el-table-column
  557. align="left"
  558. label="制单日期"
  559. prop="createTime"
  560. min-width="160"
  561. show-overflow-tooltip
  562. />
  563. <el-table-column
  564. align="left"
  565. label="区域"
  566. prop="refRegionWork"
  567. min-width="160"
  568. show-overflow-tooltip
  569. />
  570. <el-table-column
  571. align="left"
  572. label="审核人"
  573. prop="approvalName"
  574. min-width="100"
  575. show-overflow-tooltip
  576. />
  577. <el-table-column
  578. align="left"
  579. label="审核日期"
  580. prop="approvalTime"
  581. min-width="160"
  582. show-overflow-tooltip
  583. />
  584. <el-table-column
  585. align="left"
  586. label="审核状态"
  587. prop="examineStatus"
  588. min-width="100"
  589. show-overflow-tooltip
  590. >
  591. <template slot-scope="scope">
  592. {{ scope.row.examineStatus | statusFilter }}
  593. </template>
  594. </el-table-column>
  595. <el-table-column
  596. v-if="
  597. this.$store.getters.customerNumber === '100093' ||
  598. this.$store.getters.customerNumber === '600023'
  599. "
  600. align="left"
  601. label="同步到格匠采购入库单"
  602. prop="gejiangSync"
  603. min-width="160"
  604. show-overflow-tooltip
  605. >
  606. <template slot-scope="scope">
  607. {{
  608. scope.row.gejiangSync === 1
  609. ? "同步成功"
  610. : scope.row.gejiangSync === 0
  611. ? "待同步"
  612. : scope.row.gejiangSync === -1
  613. ? "同步失败"
  614. : ""
  615. }}
  616. </template>
  617. </el-table-column>
  618. <el-table-column
  619. align="left"
  620. v-if="
  621. this.$store.getters.customerNumber === '100093' ||
  622. this.$store.getters.customerNumber === '600023'
  623. "
  624. label="同步格匠失败原因"
  625. prop="gejiangSyncRemark"
  626. min-width="160"
  627. show-overflow-tooltip
  628. />
  629. <el-table-column
  630. align="center"
  631. label="操作"
  632. width="180"
  633. fixed="right"
  634. >
  635. <template slot-scope="scope">
  636. <el-popconfirm
  637. v-if="
  638. $checkBtnRole('apply', $route.meta.roles) &&
  639. scope.row.examineStatus === 'SAVE'
  640. "
  641. style="margin-right: 10px"
  642. title="确定申请吗?"
  643. @onConfirm="handleSubmit(scope.row.id, 'WAIT')"
  644. >
  645. <el-button slot="reference" type="text">申请</el-button>
  646. </el-popconfirm>
  647. <el-popconfirm
  648. v-if="
  649. $checkBtnRole('apply', $route.meta.roles) &&
  650. scope.row.examineStatus === 'WAIT'
  651. "
  652. style="margin-right: 10px"
  653. title="确定撤回吗?"
  654. @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
  655. >
  656. <el-button slot="reference" type="text">撤回</el-button>
  657. </el-popconfirm>
  658. <el-popconfirm
  659. v-if="
  660. $checkBtnRole('examine', $route.meta.roles) &&
  661. scope.row.examineStatus === 'OK'
  662. "
  663. style="margin-right: 10px"
  664. title="确定弃审吗?"
  665. @onConfirm="handleAbandon(scope.row.id)"
  666. >
  667. <el-button slot="reference" type="text">弃审</el-button>
  668. </el-popconfirm>
  669. <el-button
  670. v-if="
  671. $checkBtnRole('edit', $route.meta.roles) &&
  672. (scope.row.examineStatus === 'SAVE' ||
  673. scope.row.examineStatus === 'FAIL') &&
  674. scope.row.type === 1
  675. "
  676. type="text"
  677. @click="toForm(scope.row)"
  678. >
  679. 编辑
  680. </el-button>
  681. <el-button
  682. v-if="
  683. $checkBtnRole('edit', $route.meta.roles) &&
  684. (scope.row.examineStatus === 'SAVE' ||
  685. scope.row.examineStatus === 'FAIL') &&
  686. scope.row.type === 2
  687. "
  688. type="text"
  689. @click="toReturnForm(scope.row)"
  690. >
  691. 编辑
  692. </el-button>
  693. <el-button
  694. v-if="
  695. $checkBtnRole('examine', $route.meta.roles) &&
  696. scope.row.examineStatus === 'WAIT'
  697. "
  698. type="text"
  699. @click="toExamine(scope.row)"
  700. >
  701. 审单
  702. </el-button>
  703. <el-button type="text" @click="toDetail(scope.row)">
  704. 详情
  705. </el-button>
  706. <!-- !scope.row.automaticStatus && -->
  707. <el-popconfirm
  708. v-if="scope.row.examineStatus !== 'OK'"
  709. style="margin-left: 10px"
  710. title="确定删除吗?"
  711. @onConfirm="handleDelete(scope.row.id)"
  712. >
  713. <el-button slot="reference" type="text" style="color: #f56c6c"
  714. >删除</el-button
  715. >
  716. </el-popconfirm>
  717. </template>
  718. </el-table-column>
  719. </el-table>
  720. </div>
  721. </div>
  722. <div class="pagination clearfix">
  723. <div class="fr">
  724. <el-pagination
  725. :current-page="currentPage"
  726. :page-sizes="[10, 20, 30, 50]"
  727. :page-size="10"
  728. layout="total, sizes, prev, pager, next, jumper"
  729. :total="listTotal"
  730. @size-change="handleSizeChange"
  731. @current-change="handleCurrentChange"
  732. />
  733. </div>
  734. </div>
  735. </div>
  736. <ExamineDialog
  737. :is-show.sync="isShowExamineDialog"
  738. :examine-form.sync="examineForm"
  739. />
  740. <EnginDetail
  741. v-if="isShowDetail"
  742. ref="refDetail"
  743. :list-item="queryItem"
  744. @backListFormDetail="backList"
  745. />
  746. <EnginExamine
  747. v-if="isShowExamine"
  748. :list-item="queryItem"
  749. @backListFormDetail="backList"
  750. />
  751. <EnginForm
  752. v-if="isShowForm"
  753. :list-item="queryItem"
  754. @backListFormDetail="backList"
  755. />
  756. <EnginReturnForm
  757. v-if="isShowReturnForm"
  758. :list-item="queryItem"
  759. @backListFormDetail="backList"
  760. />
  761. </div>
  762. </template>
  763. <script>
  764. import {
  765. getEnginList,
  766. submitEngin,
  767. deleteEngin,
  768. abandonEngin,
  769. examineBatchEngin,
  770. } from "@/api/supply/apply";
  771. import { getCategoryList, getSalesmanList } from "@/api/common";
  772. import EnginDetail from "@/views/supply/apply/components/engin_detail";
  773. import EnginExamine from "@/views/supply/apply/components/engin_examine";
  774. import EnginForm from "@/views/supply/apply/components/engin_form";
  775. import EnginReturnForm from "@/views/supply/apply/components/engin_return_form";
  776. import ExamineDialog from "@/components/Common/examine-dialog";
  777. let that;
  778. export default {
  779. components: {
  780. EnginDetail,
  781. EnginExamine,
  782. EnginForm,
  783. EnginReturnForm,
  784. ExamineDialog,
  785. },
  786. filters: {
  787. statusFilter(val) {
  788. const obj = that.statusList.find((o) => o.value == val);
  789. return obj ? obj.label : "";
  790. },
  791. orderTypeFilter(val) {
  792. const obj = that.orderTypeList.find((o) => o.value == val);
  793. return obj ? obj.label : "";
  794. },
  795. },
  796. data() {
  797. return {
  798. currentPage: 1, // 当前页码
  799. pageSize: 10, // 每页数量
  800. listTotal: 0, // 列表总数
  801. dataList: null, // 列表数据
  802. listLoading: false, // 列表加载loading
  803. screenForm: {
  804. // 筛选表单数据
  805. status: "",
  806. orderNum: "",
  807. warehouse: "",
  808. jxsNum: "",
  809. jxsName: "",
  810. date: "",
  811. chName: "",
  812. model: "",
  813. salesMan: "",
  814. orderType: "",
  815. mainOrderId: "",
  816. refEnginRecordNo: "",
  817. refUseUnit: "",
  818. k3ServiceId: "",
  819. categoryId: "",
  820. approvalName: "",
  821. refRegionWork: "",
  822. createBy: "",
  823. },
  824. statusList: [
  825. { label: "已保存", value: "SAVE" },
  826. { label: "待审核", value: "WAIT" },
  827. { label: "审核通过", value: "OK" },
  828. // // { label: '审核驳回', value: 'FAIL' },,
  829. { label: "已关闭", value: "CLOSE" },
  830. ],
  831. orderTypeList: [
  832. { label: "发货申请单", value: 1 },
  833. { label: "退货申请单", value: 2 },
  834. { label: "直调发货单", value: 3 },
  835. ],
  836. salesmanList: [],
  837. queryItem: {},
  838. isShowDetail: false,
  839. isShowExamine: false,
  840. isShowForm: false,
  841. isShowReturnForm: false,
  842. selectRow: [],
  843. multipleSelection: [],
  844. isShowExamineDialog: false,
  845. examineForm: {
  846. status: "",
  847. remark: "",
  848. },
  849. isShow: false,
  850. categoryList: [],
  851. };
  852. },
  853. computed: {
  854. exParams() {
  855. return {
  856. id: this.screenForm.orderNum,
  857. correspondName: this.screenForm.warehouse,
  858. customerNumber: this.screenForm.jxsNum,
  859. customerName: this.screenForm.jxsName,
  860. productName: this.screenForm.chName,
  861. specification: this.screenForm.model,
  862. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  863. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  864. examineStatus: this.screenForm.status,
  865. serviceId: this.screenForm.salesMan,
  866. k3ServiceId: this.screenForm.k3ServiceId,
  867. type: this.screenForm.orderType,
  868. mainOrderId: this.screenForm.mainOrderId,
  869. createBy: this.screenForm.createBy,
  870. refEnginRecordNo: this.screenForm.refEnginRecordNo,
  871. refUseUnit: this.screenForm.refUseUnit,
  872. categoryId: this.screenForm.categoryId,
  873. approvalName: this.screenForm.approvalName,
  874. refRegionWork: this.screenForm.refRegionWork,
  875. };
  876. },
  877. },
  878. watch: {
  879. multipleSelection(data) {
  880. // 监听选中状态
  881. this.selectRow = [];
  882. if (data.length > 0) {
  883. data.forEach((item, index) => {
  884. this.selectRow.push(item.id);
  885. });
  886. }
  887. },
  888. },
  889. beforeCreate() {
  890. that = this;
  891. },
  892. created() {
  893. this.getSalesmanList();
  894. this.getList();
  895. this.getCategoryList();
  896. this.isShow = false;
  897. if (this.$route.query && this.$route.query.isShow) {
  898. this.isShow = this.$route.query.isShow;
  899. this.toReturnForm();
  900. }
  901. },
  902. // activated() {
  903. // // keepAlice activated 主要是从发货单汇总调用退货申请按钮
  904. // this.isShow = false
  905. // if(this.$route.query && this.$route.query.isShow){
  906. // this.isShow = this.$route.query.isShow
  907. // this.toReturnForm()
  908. // }
  909. // },
  910. methods: {
  911. // 获取业务员列表
  912. getSalesmanList() {
  913. getSalesmanList({
  914. pageNum: 1,
  915. pageSize: -1,
  916. isCustomer: 0,
  917. status: true,
  918. }).then((res) => {
  919. this.salesmanList = res.data.records;
  920. });
  921. },
  922. // 查询列表
  923. getList() {
  924. this.listLoading = true;
  925. const params = {
  926. pageNum: this.currentPage,
  927. pageSize: this.pageSize,
  928. id: this.screenForm.orderNum,
  929. correspondName: this.screenForm.warehouse,
  930. customerNumber: this.screenForm.jxsNum,
  931. customerName: this.screenForm.jxsName,
  932. productName: this.screenForm.chName,
  933. specification: this.screenForm.model,
  934. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  935. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  936. examineStatus: this.screenForm.status,
  937. createBy: this.screenForm.createBy,
  938. serviceId: this.screenForm.salesMan,
  939. k3ServiceId: this.screenForm.k3ServiceId,
  940. type: this.screenForm.orderType,
  941. mainOrderId: this.screenForm.mainOrderId,
  942. refEnginRecordNo: this.screenForm.refEnginRecordNo,
  943. refUseUnit: this.screenForm.refUseUnit,
  944. categoryId: this.screenForm.categoryId,
  945. approvalName: this.screenForm.approvalName,
  946. refRegionWork: this.screenForm.refRegionWork,
  947. };
  948. getEnginList(params).then((res) => {
  949. res.data.records.forEach((item) => {
  950. item.sums1 = ["refundableQty"];
  951. item.sums2 = [
  952. "singlePayPrice",
  953. "payAmount",
  954. "payRebateAmount",
  955. "totalDiscAmount",
  956. ];
  957. });
  958. this.dataList = res.data.records;
  959. this.listTotal = res.data.total;
  960. this.listLoading = false;
  961. });
  962. },
  963. // 提交筛选表单
  964. submitScreenForm() {
  965. this.currentPage = 1;
  966. this.getList();
  967. },
  968. // 重置筛选表单
  969. resetScreenForm() {
  970. this.$refs.screenForm.resetFields();
  971. this.currentPage = 1;
  972. this.getList();
  973. },
  974. // 更改每页数量
  975. handleSizeChange(val) {
  976. this.pageSize = val;
  977. this.currentPage = 1;
  978. this.getList();
  979. },
  980. // 更改当前页
  981. handleCurrentChange(val) {
  982. this.currentPage = val;
  983. this.getList();
  984. },
  985. // 进入表单
  986. toForm(item) {
  987. this.queryItem = item;
  988. this.isShowForm = true;
  989. },
  990. // 进入表单
  991. toReturnForm(item) {
  992. this.queryItem = item;
  993. this.isShowReturnForm = true;
  994. },
  995. // 进入审批
  996. toExamine(item) {
  997. this.queryItem = item;
  998. this.isShowExamine = true;
  999. },
  1000. // 进入详情
  1001. toDetail(item) {
  1002. this.queryItem = item;
  1003. this.isShowDetail = true;
  1004. this.$nextTick(() => {
  1005. this.$refs.refDetail.initPrint();
  1006. });
  1007. },
  1008. backList() {
  1009. this.queryItem = {};
  1010. this.isShowDetail = false;
  1011. this.isShowExamine = false;
  1012. this.isShowForm = false;
  1013. this.isShowReturnForm = false;
  1014. },
  1015. handleDelete(id) {
  1016. deleteEngin({ id }).then((res) => {
  1017. this.$successMsg();
  1018. this.getList();
  1019. });
  1020. },
  1021. // 申请/撤回
  1022. handleSubmit(id, examineStatus) {
  1023. submitEngin({ id, examineStatus }).then((res) => {
  1024. this.$successMsg();
  1025. this.getList();
  1026. });
  1027. },
  1028. // 弃审
  1029. handleAbandon(id) {
  1030. abandonEngin({ id }).then((res) => {
  1031. this.$successMsg();
  1032. this.getList();
  1033. });
  1034. },
  1035. handleSelectionChange(val) {
  1036. this.multipleSelection = val;
  1037. if (val) {
  1038. this.selections = val;
  1039. } else {
  1040. this.selections = [];
  1041. }
  1042. },
  1043. rowClass({ row, rowIndex }) {
  1044. if (this.selectRow.includes(row.id)) {
  1045. return { "background-color": "#ecf5ff" };
  1046. }
  1047. },
  1048. // 打开 批量审批
  1049. batchExamine() {
  1050. this.isShowExamineDialog = true;
  1051. },
  1052. // 提交 批量审批
  1053. submitExamineForm() {
  1054. let ids = this.multipleSelection.map((item) => {
  1055. return item.id;
  1056. });
  1057. ids = Array.from(new Set(ids));
  1058. examineBatchEngin({
  1059. ids: ids.join(","),
  1060. examineStatus: this.examineForm.status,
  1061. approvalRemark: this.examineForm.remark,
  1062. }).then((res) => {
  1063. this.isShowExamineDialog = false;
  1064. this.getList();
  1065. this.$successMsg("审批成功");
  1066. });
  1067. },
  1068. // 获取存货类别列表
  1069. getCategoryList() {
  1070. getCategoryList({
  1071. pageNum: 1,
  1072. pageSize: -1,
  1073. }).then((res) => {
  1074. this.categoryList = res.data.records;
  1075. });
  1076. },
  1077. /**
  1078. * 根据条件禁用行复选框
  1079. * 函数返回值为false则禁用选择(反之亦然)
  1080. * @param {Object} row - 行数据
  1081. * @param {String} index - 索引值
  1082. * @return Boolean
  1083. */
  1084. selectable: function (row, index) {
  1085. if (row.automaticStatus) {
  1086. return false;
  1087. }
  1088. return true;
  1089. // 函数必须有返回值且是布尔值
  1090. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1091. // 如果没有返回值则默认返回false(全部无法选中)
  1092. },
  1093. },
  1094. };
  1095. </script>
  1096. <style lang="scss" scoped></style>