sales_list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowDetail && !isShowExamine && !isShowReturnForm">
  4. <!-- 筛选条件 -->
  5. <div class="screen-container">
  6. <el-form
  7. ref="screenForm"
  8. :model="screenForm"
  9. label-width="85px"
  10. size="mini"
  11. label-position="left"
  12. >
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="24" :lg="24">
  15. <el-form-item prop="orderNum" label-width="0">
  16. <el-radio-group v-model="screenForm.status" @change="getList()">
  17. <el-radio-button label="">全部</el-radio-button>
  18. <el-radio-button
  19. v-for="(item, index) in statusList"
  20. :key="index"
  21. :label="item.value"
  22. >{{ item.label }}</el-radio-button
  23. >
  24. </el-radio-group>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="发货单号" prop="orderNum">
  29. <el-input
  30. v-model="screenForm.orderNum"
  31. placeholder="请输入发货单号(多个单号请用逗号隔开)"
  32. ></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="订单号" prop="mainOrderId">
  37. <el-input
  38. v-model="screenForm.mainOrderId"
  39. placeholder="请输入订单号"
  40. ></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :xs="24" :sm="12" :lg="6">
  44. <el-form-item label="经销商名称" prop="jxsName">
  45. <el-input
  46. v-model="screenForm.jxsName"
  47. placeholder="请输入经销商名称"
  48. ></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="经销商编号" prop="jxsNum">
  53. <el-input
  54. v-model="screenForm.jxsNum"
  55. placeholder="请输入规格型号"
  56. ></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="6">
  60. <el-form-item label="产品名称" prop="chName">
  61. <el-input
  62. v-model="screenForm.chName"
  63. placeholder="请输入产品名称"
  64. ></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="物料编码" prop="chNum">
  69. <el-input
  70. v-model="screenForm.chNum"
  71. placeholder="请输入物料编码"
  72. ></el-input>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :xs="24" :sm="12" :lg="6">
  76. <el-form-item label="规格型号" prop="model">
  77. <el-input
  78. v-model="screenForm.model"
  79. placeholder="请输入规格型号"
  80. ></el-input>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :xs="24" :sm="12" :lg="6">
  84. <el-form-item label="仓库" prop="warehouse">
  85. <el-select
  86. v-model="screenForm.warehouse"
  87. placeholder="请选择仓库"
  88. filterable
  89. clearable
  90. multiple
  91. collapse-tags
  92. style="width: 100%"
  93. >
  94. <el-option
  95. :label="item.name"
  96. :value="item.id"
  97. v-for="(item, index) in warehouseList"
  98. :key="index"
  99. ></el-option>
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :xs="24" :sm="12" :lg="6">
  104. <el-form-item label="单据日期" prop="date">
  105. <el-date-picker
  106. v-model="screenForm.date"
  107. type="datetimerange"
  108. range-separator="至"
  109. style="width: 100%"
  110. value-format="yyyy-MM-dd HH:mm:ss"
  111. start-placeholder="开始日期"
  112. end-placeholder="结束日期"
  113. >
  114. </el-date-picker>
  115. </el-form-item>
  116. </el-col>
  117. <el-col :xs="24" :sm="12" :lg="6">
  118. <el-form-item label="审核日期" prop="approval">
  119. <el-date-picker
  120. v-model="screenForm.approval"
  121. type="datetimerange"
  122. range-separator="至"
  123. style="width: 100%"
  124. value-format="yyyy-MM-dd HH:mm:ss"
  125. start-placeholder="开始日期"
  126. end-placeholder="结束日期"
  127. >
  128. </el-date-picker>
  129. </el-form-item>
  130. </el-col>
  131. <el-col :xs="24" :sm="12" :lg="6">
  132. <el-form-item label="打印时间排序" prop="printDesc">
  133. <el-select v-model="screenForm.printDesc" clearable filterable >
  134. <el-option
  135. label="默认"
  136. :value="null">
  137. </el-option>
  138. <el-option
  139. label="倒叙"
  140. :value="1">
  141. </el-option>
  142. </el-select>
  143. </el-form-item>
  144. </el-col>
  145. <el-col :xs="24" :sm="12" :lg="6">
  146. <el-form-item label="打印日期" prop="printTime">
  147. <el-date-picker
  148. v-model="screenForm.printTime"
  149. type="datetimerange"
  150. range-separator="至"
  151. style="width: 100%"
  152. value-format="yyyy-MM-dd HH:mm:ss"
  153. start-placeholder="开始日期"
  154. end-placeholder="结束日期"
  155. >
  156. </el-date-picker>
  157. </el-form-item>
  158. </el-col>
  159. <el-col :xs="24" :sm="12" :lg="6">
  160. <el-form-item label="出库单号" prop="id">
  161. <el-input
  162. v-model="screenForm.id"
  163. placeholder="请输入出库单号(多个单号请用逗号隔开)"
  164. ></el-input>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :xs="24" :sm="12" :lg="18" class="tr">
  168. <el-form-item label="">
  169. <el-button @click="resetScreenForm">清空</el-button>
  170. <el-button type="primary" @click="submitScreenForm"
  171. >搜索</el-button
  172. >
  173. </el-form-item>
  174. </el-col>
  175. </el-row>
  176. </el-form>
  177. </div>
  178. <div class="mymain-container">
  179. <div class="btn-group clearfix">
  180. <div class="fl">
  181. <el-button
  182. size="mini"
  183. type="primary"
  184. icon="el-icon-plus"
  185. @click="toReturnForm()"
  186. v-if="$checkBtnRole('refund', $route.meta.roles)"
  187. >退货申请</el-button
  188. >
  189. <el-button
  190. size="mini"
  191. type="warning"
  192. icon="el-icon-finished"
  193. @click="batchExamine"
  194. :disabled="multipleSelection.length < 1"
  195. v-if="$checkBtnRole('examine', $route.meta.roles)"
  196. >批量审批</el-button
  197. >
  198. </div>
  199. <div class="fr">
  200. <ExportButton :exUrl="'sale/order/exportChuKu'" :exParams="exParams" />
  201. </div>
  202. </div>
  203. <div class="table">
  204. <el-table
  205. v-loading="listLoading"
  206. :data="dataList"
  207. element-loading-text="Loading"
  208. border
  209. fit
  210. :row-style="rowClass"
  211. @selection-change="handleSelectionChange"
  212. show-summary
  213. :summary-method="$getSummaries"
  214. >
  215. <el-table-column
  216. align="center"
  217. type="selection"
  218. width="55"
  219. fixed="left"
  220. ></el-table-column>
  221. <el-table-column
  222. align="left"
  223. label="状态"
  224. prop="examineStatus"
  225. min-width="100"
  226. show-overflow-tooltip
  227. >
  228. <template slot-scope="scope">
  229. {{ scope.row.examineStatus | statusFilter }}
  230. </template>
  231. </el-table-column>
  232. <el-table-column
  233. align="left"
  234. label="打印时间"
  235. prop="printTime"
  236. min-width="100"
  237. show-overflow-tooltip
  238. ></el-table-column>
  239. <el-table-column
  240. align="left"
  241. label="订单类型"
  242. prop="orderType"
  243. min-width="100"
  244. show-overflow-tooltip
  245. >
  246. <template slot-scope="scope">
  247. {{ scope.row.orderType | orderTypeFilter }}
  248. </template>
  249. </el-table-column>
  250. <!-- <el-table-column
  251. align="left"
  252. label="发票号"
  253. prop="billReceipt"
  254. min-width="250"
  255. show-overflow-tooltip
  256. >
  257. <template slot-scope="scope">
  258. {{ scope.row.billReceipt }}
  259. </template>
  260. </el-table-column> -->
  261. <el-table-column
  262. align="left"
  263. label="销售出库单号"
  264. prop="id"
  265. min-width="110"
  266. show-overflow-tooltip
  267. >
  268. <template slot-scope="scope">
  269. <CopyButton :copyText="scope.row.id" />
  270. <span>{{ scope.row.id }}</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column
  274. align="left"
  275. label="发货单号"
  276. prop="orderNo"
  277. min-width="130"
  278. show-overflow-tooltip
  279. >
  280. <template slot-scope="scope">
  281. <CopyButton :copyText="scope.row.orderNo" />
  282. <span>{{ scope.row.orderNo }}</span>
  283. </template>
  284. </el-table-column>
  285. <el-table-column
  286. align="left"
  287. label="订单号"
  288. prop="orderNo"
  289. min-width="140"
  290. show-overflow-tooltip
  291. >
  292. <template slot-scope="scope">
  293. <CopyButton
  294. :copyText="
  295. scope.row.orderType === 'TRADE'
  296. ? scope.row.enginOrderNo
  297. : scope.row.mainOrderId
  298. "
  299. />
  300. <span>{{
  301. scope.row.orderType === "TRADE" ||
  302. scope.row.orderType === "HOME"
  303. ? scope.row.enginOrderNo
  304. : scope.row.mainOrderId
  305. }}</span>
  306. </template>
  307. </el-table-column>
  308. <el-table-column
  309. align="left"
  310. label="仓库"
  311. prop="correspondName"
  312. min-width="100"
  313. show-overflow-tooltip
  314. ></el-table-column>
  315. <el-table-column
  316. align="left"
  317. label="经销商编码"
  318. prop="customerNumber"
  319. min-width="100"
  320. show-overflow-tooltip
  321. >
  322. <template slot-scope="scope">
  323. <CopyButton :copyText="scope.row.customerNumber" />
  324. <span>{{ scope.row.customerNumber }}</span>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. align="left"
  329. label="经销商名称"
  330. prop="customerName"
  331. min-width="250"
  332. show-overflow-tooltip
  333. >
  334. <template slot-scope="scope">
  335. <CopyButton :copyText="scope.row.customerName" />
  336. <span>{{ scope.row.customerName }}</span>
  337. </template>
  338. </el-table-column>
  339. <el-table-column
  340. align="left"
  341. label="物料编码"
  342. prop="materialCode"
  343. min-width="120"
  344. show-overflow-tooltip
  345. >
  346. <template slot-scope="scope">
  347. <CopyButton :copyText="scope.row.materialCode" />
  348. <span>{{ scope.row.materialCode }}</span>
  349. </template>
  350. </el-table-column>
  351. <el-table-column
  352. align="left"
  353. label="产品编码"
  354. prop="materialOldNumber"
  355. min-width="140"
  356. show-overflow-tooltip
  357. >
  358. <template slot-scope="scope">
  359. <CopyButton :copyText="scope.row.materialOldNumber" />
  360. <span>{{ scope.row.materialOldNumber }}</span>
  361. </template>
  362. </el-table-column>
  363. <el-table-column
  364. align="left"
  365. label="产品名称"
  366. prop="materialName"
  367. min-width="160"
  368. show-overflow-tooltip
  369. >
  370. <template slot-scope="scope">
  371. <CopyButton :copyText="scope.row.materialName" />
  372. <span>{{ scope.row.materialName }}</span>
  373. </template>
  374. </el-table-column>
  375. <el-table-column
  376. align="left"
  377. label="规格型号"
  378. prop="specification"
  379. min-width="350"
  380. show-overflow-tooltip
  381. >
  382. <template slot-scope="scope">
  383. <CopyButton :copyText="scope.row.specification" />
  384. <span>{{ scope.row.specification }}</span>
  385. </template>
  386. </el-table-column>
  387. <el-table-column
  388. align="left"
  389. label="单位"
  390. prop="unit"
  391. min-width="100"
  392. show-overflow-tooltip
  393. ></el-table-column>
  394. <el-table-column
  395. align="right"
  396. label="数量"
  397. prop="refundableQty"
  398. min-width="100"
  399. show-overflow-tooltip
  400. ></el-table-column>
  401. <!-- <el-table-column align="right" label="单价" prop="price" min-width="100" show-overflow-tooltip>
  402. <template slot-scope="scope">
  403. {{ scope.row.price | numToFixed }}
  404. </template>
  405. </el-table-column> -->
  406. <!-- <el-table-column align="right" label="订单金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  407. <template slot-scope="scope">
  408. {{ scope.row.payAmount | numToFixed }}
  409. </template>
  410. </el-table-column> -->
  411. <!-- <el-table-column align="left" label="订单备注" prop="headerRemark" min-width="160" show-overflow-tooltip></el-table-column> -->
  412. <!-- <el-table-column align="left" label="发货申请备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column> -->
  413. <!-- <el-table-column align="left" label="表体备注" prop="invoiceRemark" min-width="160" show-overflow-tooltip></el-table-column> -->
  414. <!-- <el-table-column align="left" label="业务员" prop="serviceName" min-width="100" show-overflow-tooltip></el-table-column> -->
  415. <!-- <el-table-column align="left" label="表头业务员" prop="k3ServiceName" min-width="100" show-overflow-tooltip></el-table-column> -->
  416. <el-table-column
  417. align="center"
  418. label="操作"
  419. width="120"
  420. fixed="right"
  421. >
  422. <template slot-scope="scope">
  423. <el-button type="text" @click="toDetail(scope.row)"
  424. >详情</el-button
  425. >
  426. <el-button
  427. type="text"
  428. v-if="
  429. scope.row.type === 2 && scope.row.examineStatus !== 'OK'
  430. "
  431. @click="toDetail(scope.row), (edit = true)"
  432. >编辑</el-button
  433. >
  434. <el-button
  435. type="text"
  436. @click="toExamine(scope.row)"
  437. v-if="
  438. $checkBtnRole('examine', $route.meta.roles) &&
  439. scope.row.examineStatus === 'WAIT'
  440. "
  441. >审批</el-button
  442. >
  443. <el-popconfirm
  444. style="margin-left: 10px"
  445. title="确定弃审吗?"
  446. @onConfirm="handleAbandon(scope.row.id)"
  447. v-if="
  448. $checkBtnRole('examine', $route.meta.roles) &&
  449. scope.row.examineStatus === 'OK'
  450. "
  451. >
  452. <el-button slot="reference" type="text">弃审</el-button>
  453. </el-popconfirm>
  454. </template>
  455. </el-table-column>
  456. </el-table>
  457. </div>
  458. </div>
  459. <div class="pagination clearfix">
  460. <div class="fr">
  461. <el-pagination
  462. @size-change="handleSizeChange"
  463. @current-change="handleCurrentChange"
  464. :current-page="currentPage"
  465. :page-sizes="[10, 20, 30, 50, 100]"
  466. :page-size="10"
  467. layout="total, sizes, prev, pager, next, jumper"
  468. :total="listTotal"
  469. >
  470. </el-pagination>
  471. </div>
  472. </div>
  473. </div>
  474. <ExamineDialog
  475. :isShow.sync="isShowExamineDialog"
  476. :examineForm.sync="examineForm"
  477. />
  478. <SalesDetail
  479. :listItem="queryItem"
  480. :edit="edit"
  481. v-if="isShowDetail"
  482. @backListFormDetail="backList"
  483. />
  484. <SalesExamine
  485. :listItem="queryItem"
  486. v-if="isShowExamine"
  487. @backListFormExamine="backList"
  488. />
  489. <SalesReturnForm
  490. :listItem="queryItem"
  491. v-if="isShowReturnForm"
  492. @backListFormDetail="backList"
  493. />
  494. </div>
  495. </template>
  496. <script>
  497. import {
  498. abandonData,
  499. examineBatch,
  500. examineJudge,
  501. getList,
  502. getWarehouseList,
  503. getListOrderNo,
  504. } from "@/api/supply/sales";
  505. import SalesDetail from "@/views/supply/sales/components/sales_detail";
  506. import SalesExamine from "@/views/supply/sales/components/sales_examine";
  507. import SalesReturnForm from "@/views/supply/sales/components/sales_return_form";
  508. import ExamineDialog from "@/components/Common/examine-dialog";
  509. let that;
  510. export default {
  511. components: {
  512. SalesDetail,
  513. SalesExamine,
  514. SalesReturnForm,
  515. ExamineDialog,
  516. },
  517. filters: {
  518. statusFilter(val) {
  519. let obj = that.statusList.find((o) => o.value == val);
  520. return obj ? obj.label : "";
  521. },
  522. orderTypeFilter(val) {
  523. let obj = that.orderTypeList.find((o) => o.value == val);
  524. return obj ? obj.label : "";
  525. },
  526. billStatusFilter(val) {
  527. const MAP = {
  528. 1: "已开票",
  529. 0: "未开票",
  530. };
  531. return MAP[val];
  532. },
  533. },
  534. data() {
  535. return {
  536. currentPage: 1, // 当前页码
  537. pageSize: 10, // 每页数量
  538. listTotal: 0, // 列表总数
  539. dataList: null, // 列表数据
  540. listLoading: false, // 列表加载loading
  541. screenForm: {
  542. // 筛选表单数据
  543. orderNum: "",
  544. jxsName: "",
  545. jxsNum: "",
  546. chName: "",
  547. chNum: "",
  548. model: "",
  549. warehouse: [],
  550. date: "",
  551. status: "",
  552. mainOrderId: "",
  553. approval: "",
  554. printTime:'',
  555. printDesc:null,
  556. id: "",
  557. },
  558. statusList: [
  559. { label: "已保存", value: "SAVE" },
  560. { label: "待审核", value: "WAIT" },
  561. { label: "审核通过", value: "OK" },
  562. // { label: '审核驳回', value: 'FAIL' },,
  563. ],
  564. orderTypeList: [
  565. { label: "商用", value: "TRADE" },
  566. { label: "家用", value: "HOME" },
  567. { label: "零售单", value: "RETAIL" },
  568. { label: "销售政策单", value: "RETAIL_POLICY" },
  569. { label: "置换单家用", value: "PERMU_HOME" },
  570. { label: "置换商用", value: "PERMU_TRADE" },
  571. { label: "置换零售", value: "PERMU_RETAIL" },
  572. { label: "置换销售政策单", value: "PERMU_RETAIL_POLICY" },
  573. { label: "调拨单零售", value: "REQUISITION_RETAIL" },
  574. { label: "调拨单销售政策", value: "REQUISITION_RETAIL_POLICY" },
  575. { label: "调拨单商用", value: "REQUISITION_TRADE" },
  576. { label: "调拨单家用", value: "REQUISITION_HOME" },
  577. ],
  578. warehouseList: [],
  579. centerDialogVisible: false,
  580. cid: "",
  581. queryItem: {},
  582. isShowDetail: false,
  583. isShowExamine: false,
  584. isShowReturnForm: false,
  585. value1: "",
  586. qty: "",
  587. edit: false,
  588. choiceDate: "",
  589. selectRow: [],
  590. multipleSelection: [],
  591. isShowExamineDialog: false,
  592. examineForm: {
  593. status: "",
  594. remark: "",
  595. },
  596. setDisabled: {
  597. disabledDate: (time) => {
  598. if (this.choiceDate) {
  599. const res = 13 * 24 * 3600 * 1000;
  600. const minTime = this.choiceDate - res;
  601. const maxTime = this.choiceDate + res;
  602. return time.getTime() < minTime || time.getTime() > maxTime;
  603. }
  604. },
  605. onPick: ({ maxDate, minDate }) => {
  606. this.choiceDate = minDate.getTime();
  607. if (maxDate) this.choiceDate = "";
  608. },
  609. },
  610. };
  611. },
  612. computed: {
  613. exParams() {
  614. return {
  615. examineStatus: this.screenForm.status,
  616. orderNo: this.screenForm.orderNum.replace(/,/gi, ","),
  617. customerName: this.screenForm.jxsName,
  618. customerNumber: this.screenForm.jxsNum,
  619. materialName: this.screenForm.chName,
  620. materialNumber: this.screenForm.chNum,
  621. specification: this.screenForm.model,
  622. correspondId: this.screenForm.warehouse.join(","),
  623. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  624. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  625. approvalStartTime: this.screenForm.approval
  626. ? this.screenForm.approval[0]
  627. : "",
  628. approvalEndTime: this.screenForm.approval
  629. ? this.screenForm.approval[1]
  630. : "",
  631. printStartTime:this.screenForm.printTime
  632. ? this.screenForm.printTime[0]
  633. : "",
  634. printEndtTime:this.screenForm.printTime
  635. ? this.screenForm.printTime[1]
  636. : "",
  637. mainOrderId: this.screenForm.mainOrderId,
  638. printTimeDesc:this.screenForm.printDesc,
  639. id: this.screenForm.id.replace(/,/gi, ","),
  640. };
  641. },
  642. },
  643. watch: {
  644. multipleSelection(data) {
  645. // 监听选中状态
  646. this.selectRow = [];
  647. if (data.length > 0) {
  648. data.forEach((item, index) => {
  649. this.selectRow.push(item.id);
  650. });
  651. }
  652. },
  653. },
  654. beforeCreate() {
  655. that = this;
  656. },
  657. created() {
  658. this.getWarehouseList();
  659. this.getList();
  660. },
  661. methods: {
  662. // 查询列表
  663. getList() {
  664. this.listLoading = true;
  665. let params = {
  666. pageNum: this.currentPage,
  667. pageSize: this.pageSize,
  668. examineStatus: this.screenForm.status,
  669. orderNo: this.screenForm.orderNum.replace(/,/gi, ","),
  670. customerName: this.screenForm.jxsName,
  671. customerNumber: this.screenForm.jxsNum,
  672. materialName: this.screenForm.chName,
  673. materialNumber: this.screenForm.chNum,
  674. specification: this.screenForm.model,
  675. correspondId: this.screenForm.warehouse.join(","),
  676. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  677. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  678. approvalStartTime: this.screenForm.approval
  679. ? this.screenForm.approval[0]
  680. : "",
  681. approvalEndTime: this.screenForm.approval
  682. ? this.screenForm.approval[1]
  683. : "",
  684. mainOrderId: this.screenForm.mainOrderId,
  685. printStartTime:this.screenForm.printTime
  686. ? this.screenForm.printTime[0]
  687. : "",
  688. printEndtTime:this.screenForm.printTime
  689. ? this.screenForm.printTime[1]
  690. : "",
  691. printTimeDesc:this.screenForm.printDesc,
  692. id: this.screenForm.id.replace(/,/gi, ","),
  693. };
  694. getList(params).then((res) => {
  695. res.data.records.forEach((item) => {
  696. item.sums1 = ["refundableQty"];
  697. item.sums2 = ["price", "payAmount"];
  698. });
  699. this.dataList = res.data.records;
  700. this.listTotal = res.data.total;
  701. this.listLoading = false;
  702. });
  703. },
  704. // 获取仓库列表
  705. getWarehouseList() {
  706. getWarehouseList({
  707. pageNum: 1,
  708. pageSize: -1,
  709. }).then((res) => {
  710. this.warehouseList = res.data.records;
  711. });
  712. },
  713. updateReceipt() {
  714. if (!this.value1) {
  715. this.$errorMsg("请选择时间");
  716. return;
  717. }
  718. // updateReceipt({
  719. // startTime:this.value1[0],
  720. // endTime:this.value1[1]
  721. // }).then(res=>{
  722. // this.getList();
  723. // this.$successMsg("已更新");
  724. // this.value1 = ''
  725. // })
  726. },
  727. // 提交筛选表单
  728. submitScreenForm() {
  729. this.currentPage = 1;
  730. this.getList();
  731. if (this.screenForm.orderNum) {
  732. getListOrderNo({
  733. orderNo: this.screenForm.orderNum.replace(/,/gi, ","),
  734. }).then((res) => {
  735. if (res.data) {
  736. this.$confirm(res.data, "提示", {
  737. confirmButtonText: "确定",
  738. showCancelButton:false
  739. });
  740. }
  741. });
  742. }
  743. },
  744. // 重置筛选表单
  745. resetScreenForm() {
  746. this.$refs.screenForm.resetFields();
  747. this.currentPage = 1;
  748. this.getList();
  749. },
  750. // 更改每页数量
  751. handleSizeChange(val) {
  752. this.pageSize = val;
  753. this.currentPage = 1;
  754. this.getList();
  755. },
  756. // 更改当前页
  757. handleCurrentChange(val) {
  758. this.currentPage = val;
  759. this.getList();
  760. },
  761. // 判断是否可以审批
  762. async examineJudge(item) {
  763. // 获取页面模版
  764. const result = await new Promise((resolve, reject) => {
  765. examineJudge({ id: item.id })
  766. .then((res) => {
  767. resolve(res.code == 200);
  768. })
  769. .catch((res) => {
  770. resolve(0);
  771. });
  772. });
  773. return result;
  774. },
  775. // 进入表单
  776. toReturnForm(item) {
  777. this.queryItem = item;
  778. this.isShowReturnForm = true;
  779. },
  780. // 进入详情
  781. toDetail(item) {
  782. this.queryItem = item;
  783. this.isShowDetail = true;
  784. },
  785. // 进入审批
  786. async toExamine(item) {
  787. const canExamine = await this.examineJudge(item);
  788. if (!canExamine) {
  789. return false;
  790. }
  791. this.queryItem = item;
  792. this.isShowExamine = true;
  793. },
  794. backList() {
  795. this.queryItem = {};
  796. this.isShowDetail = false;
  797. this.isShowExamine = false;
  798. this.isShowReturnForm = false;
  799. },
  800. handleSelectionChange(val) {
  801. this.multipleSelection = val;
  802. if (val) {
  803. this.selections = val;
  804. } else {
  805. this.selections = [];
  806. }
  807. },
  808. rowClass({ row, rowIndex }) {
  809. if (this.selectRow.includes(row.id)) {
  810. return { "background-color": "#ecf5ff" };
  811. }
  812. },
  813. // 打开 批量审批
  814. batchExamine() {
  815. this.isShowExamineDialog = true;
  816. },
  817. // 提交 批量审批
  818. submitExamineForm() {
  819. let ids = this.multipleSelection.map((item) => {
  820. return item.id;
  821. });
  822. examineBatch({
  823. ids: ids.join(","),
  824. examineStatus: this.examineForm.status,
  825. approvalRemark: this.examineForm.remark,
  826. }).then((res) => {
  827. this.isShowExamineDialog = false;
  828. this.getList();
  829. this.$successMsg("修改成功");
  830. });
  831. },
  832. // 弃审
  833. handleAbandon(id) {
  834. abandonData({ id }).then((res) => {
  835. this.$successMsg();
  836. this.getList();
  837. });
  838. },
  839. },
  840. };
  841. </script>
  842. <style lang="scss" scoped></style>