check.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944
  1. <template>
  2. <div class="app-container">
  3. <div v-show="!isShowPrint">
  4. <div class="main-title" style="margin-top: 0">
  5. <div class="title">仓库提货确认</div>
  6. </div>
  7. <div>
  8. <el-form
  9. ref="screenForm"
  10. :model="screenForm"
  11. label-width="96px"
  12. size="mini"
  13. label-position="right"
  14. >
  15. <el-row :gutter="20">
  16. <el-col :xs="24" :sm="24" :lg="24">
  17. <el-form-item label="提货方式">
  18. <el-radio-group v-model="check" @change="handleReset">
  19. <el-radio :label="1">商家自提</el-radio>
  20. <el-radio :label="0">物流公司</el-radio>
  21. </el-radio-group>
  22. </el-form-item>
  23. </el-col>
  24. </el-row>
  25. <template v-if="!check">
  26. <el-row :gutter="20">
  27. <el-col :xs="24" :sm="8" :lg="6">
  28. <el-form-item label="物流公司" prop="logisticsId">
  29. <el-select
  30. v-model="screenForm.logisticsId"
  31. placeholder="全部"
  32. style="width: 100%"
  33. >
  34. <el-option
  35. :label="item.logisticsCompany"
  36. :value="item.id"
  37. v-for="(item, index) in companyList"
  38. :key="index"
  39. ></el-option>
  40. </el-select>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :xs="24" :sm="8" :lg="6">
  44. <el-form-item label="经销商" prop="customerId">
  45. <!-- v-select-loadmore:[myData]="loadmore" -->
  46. <el-select v-model="screenForm.customerId" placeholder="选择经销商" clearable filterable >
  47. <el-option v-for="item in dealerList2"
  48. :key="item.id"
  49. :label="item.name"
  50. :value="item.id">
  51. </el-option>
  52. </el-select>
  53. </el-form-item>
  54. </el-col>
  55. <el-col :xs="24" :sm="8" :lg="6">
  56. <el-form-item label="仓库" prop="warehouse">
  57. <el-select v-model="screenForm.warehouse" placeholder="选择仓库" clearable filterable >
  58. <el-option v-for="item in warehouseList"
  59. :key="item.id"
  60. :label="item.name"
  61. :value="item.id">
  62. </el-option>
  63. </el-select>
  64. </el-form-item>
  65. </el-col>
  66. <el-col :xs="24" :sm="8" :lg="6">
  67. <el-button size="mini" type="primary" @click="getList"
  68. >查 询</el-button
  69. >
  70. </el-col>
  71. </el-row>
  72. </template>
  73. <template v-else>
  74. <el-row :gutter="20">
  75. <el-col :xs="24" :sm="8" :lg="6">
  76. <el-form-item label="提货人手机号" prop="phone">
  77. <el-input
  78. v-model="screenForm.phone"
  79. placeholder="请输入提货人手机号"
  80. ></el-input>
  81. </el-form-item>
  82. </el-col>
  83. <el-col :xs="24" :sm="3" :lg="3">
  84. <el-button
  85. size="mini"
  86. type="primary"
  87. @click="getCode"
  88. :disabled="!screenForm.phone || countDown != 60"
  89. >{{
  90. countDown == 60 ? getCodeText : "重新获取(" + countDown + "s)"
  91. }}</el-button
  92. >
  93. </el-col>
  94. <el-col :xs="24" :sm="8" :lg="8">
  95. <el-form-item label="验证码" prop="code">
  96. <el-input
  97. v-model="screenForm.code"
  98. placeholder="请输入验证码"
  99. ></el-input>
  100. </el-form-item>
  101. </el-col>
  102. <el-col :xs="24" :sm="3" :lg="3">
  103. <el-button
  104. size="mini"
  105. type="primary"
  106. :disabled="!screenForm.phone || !screenForm.code"
  107. @click="getPickupManInfo"
  108. >确 认</el-button
  109. >
  110. </el-col>
  111. </el-row>
  112. <el-row :gutter="20">
  113. <el-col :xs="24" :sm="8" :lg="8">
  114. <el-form-item label="提货人姓名" prop="name">
  115. <!-- <el-input v-model="screenForm.name" placeholder="请通过手机验证获取" ></el-input> -->
  116. <el-select
  117. style="width: 100%"
  118. v-model="screenForm.name"
  119. placeholder="请选提货人姓名"
  120. clearable
  121. filterable
  122. @change="onChage"
  123. >
  124. <el-option
  125. v-for="item in userList"
  126. :key="item.id"
  127. :label="`${item.takerName} - ${item.customerName}`"
  128. :value="item.id"
  129. >
  130. </el-option>
  131. </el-select>
  132. </el-form-item>
  133. </el-col>
  134. <el-col :xs="24" :sm="8" :lg="8">
  135. <el-form-item label="提货人身份证" prop="idCard">
  136. <el-input
  137. v-model="screenForm.idCard"
  138. placeholder="请通过手机验证获取"
  139. readonly
  140. ></el-input>
  141. </el-form-item>
  142. </el-col>
  143. </el-row>
  144. <el-row :gutter="20">
  145. <el-col :xs="24" :sm="8" :lg="8">
  146. <el-form-item label="经销商" prop="customerName">
  147. <el-input
  148. v-model="screenForm.customerName"
  149. placeholder="经销商"
  150. readonly
  151. ></el-input>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :xs="24" :sm="8" :lg="8">
  155. <el-form-item label="仓库" prop="warehouse">
  156. <el-select
  157. v-model="screenForm.warehouse"
  158. placeholder="请选择仓库"
  159. filterable
  160. clearable
  161. style="width: 100%"
  162. >
  163. <el-option
  164. :label="item.name"
  165. :value="item.id"
  166. v-for="(item, index) in warehouseList"
  167. :key="index"
  168. ></el-option>
  169. </el-select>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :xs="24" :sm="5" :lg="5">
  173. <el-button size="mini" type="primary" @click="getList"
  174. >查 询</el-button
  175. >
  176. </el-col>
  177. </el-row>
  178. </template>
  179. <el-row :gutter="20">
  180. <el-col :xs="24" :sm="24" :lg="24">
  181. <el-form-item prop="status" label-width="0">
  182. <el-radio-group
  183. v-model="screenForm.status"
  184. size="mini"
  185. @change="getList()"
  186. >
  187. <el-radio-button
  188. v-for="(item, index) in statusList"
  189. :key="index"
  190. :label="item.value"
  191. >{{ item.label }}</el-radio-button
  192. >
  193. </el-radio-group>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. </el-form>
  198. </div>
  199. <div>
  200. <el-form :model="screenForm" ref="form" label-width="120px" size="mini">
  201. <el-row :gutter="20">
  202. <el-col :xs="24" :sm="8" :lg="8">
  203. <el-form-item label="申请发货单号">
  204. <el-input v-model="screenForm.invoiceId" clearable></el-input>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :xs="24" :sm="8" :lg="8">
  208. <el-button size="mini" type="primary" @click="getList"
  209. >查 询</el-button
  210. >
  211. </el-col>
  212. </el-row>
  213. </el-form>
  214. </div>
  215. <div class="main-title">
  216. <div class="title">提货单</div>
  217. <div class="fr">
  218. <ExportButton :exUrl="'pick/storeExport'" :exParams="exParams" />
  219. </div>
  220. </div>
  221. <div class="mymain-container">
  222. <div class="table">
  223. <el-table
  224. ref="table"
  225. v-loading="listLoading"
  226. :data="dataList"
  227. element-loading-text="Loading"
  228. border
  229. fit
  230. highlight-current-row
  231. stripe
  232. @select="handleSelect"
  233. @select-all="handleSelectAll"
  234. >
  235. <el-table-column
  236. align="left"
  237. type="selection"
  238. width="55"
  239. ></el-table-column>
  240. <!-- <el-table-column align="left" label="操作" width="100" fixed="left">
  241. <template slot-scope="scope">
  242. <el-button type="text" @click="toPrint(scope.row)">打印</el-button>
  243. </template>
  244. </el-table-column> -->
  245. <el-table-column
  246. align="left"
  247. label="状态"
  248. min-width="100"
  249. show-overflow-tooltip
  250. >
  251. <template slot-scope="scope">
  252. {{
  253. scope.row.printNum
  254. ? "已打单(" + scope.row.printNum + ")"
  255. : "未打单"
  256. }}
  257. </template>
  258. </el-table-column>
  259. <el-table-column
  260. align="left"
  261. label="信息密钥"
  262. prop="informationKey"
  263. min-width="120"
  264. show-overflow-tooltip
  265. >
  266. <template slot-scope="scope">
  267. <CopyButton :copyText="scope.row.informationKey" />
  268. <span>{{ scope.row.informationKey }}</span>
  269. </template>
  270. </el-table-column>
  271. <el-table-column
  272. align="left"
  273. label="经销商编码"
  274. prop="customerNumber"
  275. min-width="100"
  276. show-overflow-tooltip
  277. >
  278. <template slot-scope="scope">
  279. <CopyButton :copyText="scope.row.customerNumber" />
  280. <span>{{ scope.row.customerNumber }}</span>
  281. </template>
  282. </el-table-column>
  283. <el-table-column
  284. align="left"
  285. label="经销商名称"
  286. prop="customerName"
  287. min-width="250"
  288. show-overflow-tooltip
  289. >
  290. <template slot-scope="scope">
  291. <CopyButton :copyText="scope.row.customerName" />
  292. <span>{{ scope.row.customerName }}</span>
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. align="left"
  297. label="预约日期"
  298. prop="pickTime"
  299. min-width="120"
  300. show-overflow-tooltip
  301. >
  302. <template slot-scope="scope">
  303. {{ scope.row.pickTime | dateToDayFilter }}
  304. </template>
  305. </el-table-column>
  306. <el-table-column
  307. align="left"
  308. label="提货时段"
  309. min-width="100"
  310. show-overflow-tooltip
  311. >
  312. <template slot-scope="scope">
  313. {{ scope.row.pickStatus == "1" ? "上午" : "下午" }}
  314. </template>
  315. </el-table-column>
  316. <el-table-column
  317. align="left"
  318. label="销售订单号"
  319. prop="mainOrderId"
  320. min-width="160"
  321. show-overflow-tooltip
  322. >
  323. <template slot-scope="scope">
  324. <CopyButton
  325. :copyText="
  326. (scope.row.orderType === 'TRADE' ||
  327. scope.row.orderType === 'HOME' ||
  328. scope.row.orderType === 'REQUISITION_TRADE' ||
  329. scope.row.orderType === 'REQUISITION_HOME')
  330. ? scope.row.enginOrderNo
  331. : scope.row.mainOrderId
  332. "
  333. />
  334. <span>{{
  335. (scope.row.orderType === "TRADE" ||
  336. scope.row.orderType === "HOME" ||
  337. scope.row.orderType === "REQUISITION_TRADE" ||
  338. scope.row.orderType === "REQUISITION_HOME")
  339. ? scope.row.enginOrderNo
  340. : scope.row.mainOrderId
  341. }}</span>
  342. </template>
  343. </el-table-column>
  344. <el-table-column
  345. align="left"
  346. label="发货申请单号"
  347. prop="invoiceId"
  348. min-width="130"
  349. show-overflow-tooltip
  350. >
  351. <template slot-scope="scope">
  352. <CopyButton :copyText="scope.row.invoiceId" />
  353. <span>{{ scope.row.invoiceId }}</span>
  354. </template>
  355. </el-table-column>
  356. <el-table-column
  357. align="left"
  358. label="销售类型"
  359. prop="saleTypeName"
  360. min-width="100"
  361. show-overflow-tooltip
  362. ></el-table-column>
  363. <el-table-column
  364. align="left"
  365. label="物料编码"
  366. prop="materialCode"
  367. min-width="120"
  368. show-overflow-tooltip
  369. >
  370. <template slot-scope="scope">
  371. <CopyButton :copyText="scope.row.materialCode" />
  372. <span>{{ scope.row.materialCode }}</span>
  373. </template>
  374. </el-table-column>
  375. <el-table-column
  376. align="left"
  377. label="产品编码"
  378. prop="materialOldNumber"
  379. min-width="140"
  380. show-overflow-tooltip
  381. >
  382. <template slot-scope="scope">
  383. <CopyButton :copyText="scope.row.materialOldNumber" />
  384. <span>{{ scope.row.materialOldNumber }}</span>
  385. </template>
  386. </el-table-column>
  387. <el-table-column
  388. align="left"
  389. label="产品名称"
  390. prop="materialName"
  391. min-width="160"
  392. show-overflow-tooltip
  393. >
  394. <template slot-scope="scope">
  395. <CopyButton :copyText="scope.row.materialName" />
  396. <span>{{ scope.row.materialName }}</span>
  397. </template>
  398. </el-table-column>
  399. <el-table-column
  400. align="left"
  401. label="规格型号"
  402. prop="specification"
  403. min-width="350"
  404. show-overflow-tooltip
  405. >
  406. <template slot-scope="scope">
  407. <CopyButton :copyText="scope.row.specification" />
  408. <span>{{ scope.row.specification }}</span>
  409. </template>
  410. </el-table-column>
  411. <el-table-column
  412. align="left"
  413. label="单位"
  414. prop="unit"
  415. min-width="100"
  416. show-overflow-tooltip
  417. ></el-table-column>
  418. <el-table-column
  419. align="left"
  420. label="数量"
  421. prop="refundableQty"
  422. min-width="100"
  423. show-overflow-tooltip
  424. ></el-table-column>
  425. <!-- <el-table-column align="left" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  426. <el-table-column align="left" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  427. <el-table-column align="left" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
  428. <el-table-column align="left" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column> -->
  429. <el-table-column
  430. align="left"
  431. label="仓库"
  432. prop="correspondName"
  433. min-width="160"
  434. show-overflow-tooltip
  435. ></el-table-column>
  436. <el-table-column
  437. align="left"
  438. label="提货方式"
  439. prop="pickType"
  440. min-width="100"
  441. show-overflow-tooltip
  442. >
  443. <template slot-scope="scope">
  444. {{ scope.row.pickType == "1" ? "自提" : "物流快递" }}
  445. </template>
  446. </el-table-column>
  447. <el-table-column
  448. align="left"
  449. label="提货人/物流公司"
  450. prop="takerName"
  451. min-width="160"
  452. show-overflow-tooltip
  453. >
  454. <template slot-scope="scope">
  455. {{
  456. scope.row.pickType == "1"
  457. ? scope.row.takerName
  458. : scope.row.pickLogistics
  459. }}
  460. </template>
  461. </el-table-column>
  462. </el-table>
  463. </div>
  464. </div>
  465. <div class="pagination clearfix">
  466. <div class="fr">
  467. <el-pagination
  468. @size-change="handleSizeChange"
  469. @current-change="handleCurrentChange"
  470. :current-page="currentPage"
  471. :page-sizes="[200, 300, 500]"
  472. :page-size="10"
  473. layout="total, sizes, prev, pager, next, jumper"
  474. :total="listTotal">
  475. </el-pagination>
  476. </div>
  477. </div>
  478. <div class="page-footer">
  479. <div class="footer">
  480. <el-button
  481. type="primary"
  482. @click="toPrint"
  483. :disabled="tableSelection.length < 1"
  484. v-if="$checkBtnRole('print', $route.meta.roles)"
  485. >打印发货单</el-button
  486. >
  487. </div>
  488. </div>
  489. </div>
  490. <el-dialog
  491. title="密码确认"
  492. :visible.sync="isShowDialog"
  493. :show-close="false"
  494. width="40%"
  495. :close-on-click-modal="false"
  496. >
  497. <el-form
  498. ref="dialogForm"
  499. :model="dialogForm"
  500. :rules="dialogFormRules"
  501. label-position="right"
  502. label-width="70px"
  503. >
  504. <el-row :gutter="20">
  505. <el-col :xs="24" :sm="24" :lg="24">
  506. <el-form-item label="密码" prop="password">
  507. <el-input
  508. v-model="dialogForm.password"
  509. autocomplete="off"
  510. placeholder="请输入密码"
  511. ></el-input>
  512. </el-form-item>
  513. </el-col>
  514. <el-col :xs="24" :sm="12" :lg="12">
  515. <el-form-item label="操作人" prop="createMan">
  516. <el-input v-model="dialogForm.createMan" readonly></el-input>
  517. </el-form-item>
  518. </el-col>
  519. <el-col :xs="24" :sm="12" :lg="12" style="height: 51px">
  520. <el-form-item label="操作日期" prop="createDate">
  521. <el-date-picker
  522. v-model="dialogForm.createDate"
  523. readonly
  524. type="date"
  525. value-format="yyyy-MM-dd"
  526. style="width: 100%"
  527. placeholder="选择日期"
  528. >
  529. </el-date-picker>
  530. </el-form-item>
  531. </el-col>
  532. </el-row>
  533. </el-form>
  534. <div slot="footer" class="dialog-footer">
  535. <el-button @click="cancelDialogForm">取 消</el-button>
  536. <el-button type="primary" @click="submitDialogForm">确 定</el-button>
  537. </div>
  538. </el-dialog>
  539. <print-preview ref="preView" />
  540. <!-- <PickupPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" /> -->
  541. </div>
  542. </template>
  543. <script>
  544. import {
  545. getPickupList,
  546. getCode,
  547. getCompanyList,
  548. getPickupManInfo,
  549. checkPassword,
  550. getWarehouseList,
  551. getDetailPrintDisString,
  552. } from "@/api/supply/pickup";
  553. import print from "@/mixin/print";
  554. import { getDealerList, getListCustomer } from "@/api/basic_data/dealer";
  555. import PickupPrint from "@/views/supply/pickup/components/pickup_print";
  556. import printPreview from "./components/design/preview.vue";
  557. export default {
  558. components: {
  559. PickupPrint,
  560. printPreview,
  561. },
  562. mixins: [print],
  563. data() {
  564. return {
  565. currentPage: 1, // 当前页码
  566. pageSize: 10, // 每页数量
  567. listTotal: 0, // 列表总数
  568. dataList: null, // 列表数据
  569. listLoading: false, // 列表加载loading
  570. screenForm: {
  571. // 筛选表单数据
  572. phone: "",
  573. code: "",
  574. name: "",
  575. idCard: "",
  576. manId: "",
  577. status: 0,
  578. customerName: "",
  579. warehouse: "",
  580. customerId: "",
  581. logisticsId:"",
  582. storeId:"",
  583. invoiceId:''
  584. },
  585. statusList: [
  586. { label: "未打单", value: 0 },
  587. { label: "已打单", value: 1 },
  588. ],
  589. warehouseList: [],
  590. getCodeText: "获取验证码",
  591. countDown: 60,
  592. timer: null,
  593. myData:{
  594. class:".el-select-dropdown .el-select-dropdown__wrap"
  595. },
  596. tableSelection: [],
  597. companyList:[],
  598. queryItem: {},
  599. isShowPrint: false,
  600. dealerList: [],
  601. isShowDialog: false,
  602. dialogForm: {
  603. password: "",
  604. createMan: "",
  605. createDate: "",
  606. },
  607. dialogFormRules: {
  608. password: [{ required: true, message: "请输入密码", trigger: "blur" }],
  609. },
  610. userList: [],
  611. isShowDialog: false,
  612. radio: 0,
  613. check:1,
  614. logisticsArr:[],
  615. pageNum:1,
  616. listTotal:0,
  617. dealerList2:[]
  618. };
  619. },
  620. computed: {
  621. exParams() {
  622. return {
  623. takerId: this.screenForm.manId,
  624. status: this.screenForm.status,
  625. };
  626. },
  627. },
  628. created() {
  629. this.getDealerList()
  630. this.getCompanyList()
  631. this.getWarehouseList();
  632. },
  633. // activated(){
  634. // this.initPrint()
  635. // },
  636. mounted() {
  637. this.initPrint();
  638. },
  639. methods: {
  640. handleReset(){
  641. this.screenForm.customerId = ''
  642. this.screenForm.logisticsId =''
  643. this.screenForm.warehouse = ''
  644. this.screenForm.invoiceId = ''
  645. this.screenForm.status = '0'
  646. this.dataList = [];
  647. this.listTotal = 0;
  648. this.listLoading = false;
  649. },
  650. getDate() {
  651. var date = new Date();
  652. var seperator1 = "-";
  653. var year = date.getFullYear();
  654. var month = date.getMonth() + 1;
  655. var strDate = date.getDate();
  656. if (month >= 1 && month <= 9) {
  657. month = "0" + month;
  658. }
  659. if (strDate >= 0 && strDate <= 9) {
  660. strDate = "0" + strDate;
  661. }
  662. var currentdate = year + seperator1 + month + seperator1 + strDate;
  663. return currentdate;
  664. },
  665. async getDealerList() {
  666. const res = await getDealerList({ pageNum: 1, pageSize: -1 });
  667. // this.dealerList = [...this.dealerList,...res.data.records];
  668. this.dealerList2 = res.data.records
  669. this.dealerList = res.data.records;
  670. this.listTotal = res.data.total
  671. },
  672. loadmore() {
  673. let len = Math.ceil(this.listTotal/50)
  674. if (this.pageNum<=len) {
  675. this.pageNum++
  676. this.getDealerList()
  677. }
  678. },
  679. // 获取物流公司列表
  680. getCompanyList() {
  681. getCompanyList({
  682. pageNum: 1,
  683. pageSize: -1,
  684. }).then((res) => {
  685. this.companyList = res.data.records;
  686. });
  687. },
  688. getLogisticsId(e){
  689. const item = this.companyList.find(k=>k.id===e)
  690. this.screenForm.company = item.logisticsCompany
  691. },
  692. // 获取仓库列表
  693. getWarehouseList() {
  694. getWarehouseList({
  695. pageNum: 1,
  696. pageSize: -1,
  697. }).then((res) => {
  698. this.warehouseList = res.data.records;
  699. });
  700. },
  701. // 获取短信验证码
  702. getCode() {
  703. getCode({ mobile: this.screenForm.phone }).then((res) => {
  704. this.$successMsg("短信已发送");
  705. this.countDown--;
  706. this.timer = setInterval(() => {
  707. this.countDown--;
  708. if (this.countDown == 0) {
  709. this.countDown = 60;
  710. this.getCodeText = "重新获取";
  711. clearInterval(this.timer);
  712. }
  713. }, 1000);
  714. });
  715. },
  716. // 获取提货人信息
  717. getPickupManInfo() {
  718. getPickupManInfo({
  719. mobile: this.screenForm.phone,
  720. code: this.screenForm.code,
  721. }).then((res) => {
  722. this.$successMsg("验证成功");
  723. this.screenForm.name = `${res.data[0].takerName} - ${res.data[0].customerName}`;
  724. this.screenForm.idCard = res.data[0].identity;
  725. this.screenForm.manId = res.data[0].id;
  726. this.screenForm.customerName = res.data[0].customerName;
  727. this.screenForm.customerId = res.data[0].customerId;
  728. this.userList = res.data;
  729. this.getListCustomer();
  730. });
  731. },
  732. onChage(e) {
  733. const userInfo = this.userList.filter((k) => {
  734. return e === k.id;
  735. });
  736. this.screenForm.name = `${userInfo[0].takerName} - ${userInfo[0].customerName}`;
  737. this.screenForm.idCard = userInfo[0].identity;
  738. this.screenForm.manId = userInfo[0].id;
  739. this.screenForm.customerName = userInfo[0].customerName;
  740. this.screenForm.customerId = userInfo[0].customerId;
  741. },
  742. getListCustomer() {
  743. getListCustomer({
  744. keyword: "",
  745. phone: this.screenForm.phone,
  746. pageNum: 1,
  747. pageSize: -1,
  748. }).then((res) => {
  749. this.dealerList = res.data.records;
  750. // this.screenForm.customerNumber = this.dataList[0].number
  751. });
  752. },
  753. // 查询列表
  754. getList() {
  755. if (this.check=='1') {
  756. if (!this.screenForm.manId) {
  757. return this.$errorMsg("请先查询提货人信息");
  758. }
  759. }else{
  760. if (!this.screenForm.logisticsId) {
  761. return this.$errorMsg("请选择物流公司");
  762. }
  763. }
  764. if (!this.screenForm.warehouse) {
  765. return this.$errorMsg("请选择仓库");
  766. }
  767. this.listLoading = true;
  768. let params = {
  769. pageNum: this.currentPage,
  770. pageSize: 200,
  771. // takerId: this.screenForm.manId,
  772. status: this.screenForm.status,
  773. takerPhone: this.screenForm.phone,
  774. // customerName:this.screenForm.customerName,
  775. correspondId: this.screenForm.warehouse,
  776. customerId: this.screenForm.customerId,
  777. logisticsId:this.screenForm.logisticsId,
  778. invoiceId:this.screenForm.invoiceId
  779. };
  780. getPickupList(params).then((res) => {
  781. this.dataList = res.data.records;
  782. this.listTotal = res.data.total;
  783. this.listLoading = false;
  784. });
  785. },
  786. // 更改每页数量
  787. handleSizeChange(val) {
  788. this.pageSize = val;
  789. this.currentPage = 1;
  790. this.getList();
  791. },
  792. // 更改当前页
  793. handleCurrentChange(val) {
  794. this.currentPage = val;
  795. this.getList();
  796. },
  797. backList() {
  798. this.queryItem = {};
  799. this.isShowPrint = false;
  800. },
  801. handleSelect(selection, row) {
  802. this.$refs.table.toggleRowSelection(row);
  803. this.dataList.forEach((item) => {
  804. if (item.informationKey === row.informationKey) {
  805. this.$refs.table.toggleRowSelection(item);
  806. }
  807. });
  808. this.tableSelection = this.$refs.table.selection;
  809. },
  810. handleSelectAll(selection) {
  811. this.tableSelection = this.$refs.table.selection;
  812. },
  813. // 检查是否一致
  814. isAllEqual(array) {
  815. if (array.length > 0) {
  816. return !array.some(function (item, index) {
  817. return item.informationKey !== array[0].informationKey;
  818. });
  819. } else {
  820. return true;
  821. }
  822. },
  823. // 点击打印
  824. async toPrint() {
  825. const params = [];
  826. const len = this.tableSelection.length;
  827. this.queryItem = this.tableSelection;
  828. for (let i = len; i > 0; i--) {
  829. params.push({
  830. id: this.tableSelection[i - 1].id,
  831. invoiceId: this.tableSelection[i - 1].invoiceId,
  832. });
  833. }
  834. const { data } = await getDetailPrintDisString(params);
  835. console.log(data);
  836. if (data) {
  837. this.$confirm(<p class="text">{data}</p>, "提示", {
  838. confirmButtonText: "确定",
  839. cancelButtonText: "取消",
  840. customClass: "text",
  841. }).then(() => {
  842. if (this.tableSelection[0].printNum) {
  843. this.dialogForm.createMan = JSON.parse(
  844. localStorage.getItem("supply_user")
  845. ).nickName;
  846. this.dialogForm.createDate = this.getDate();
  847. this.isShowDialog = true;
  848. }
  849. });
  850. } else {
  851. this.getDateil(this.tableSelection, "getDtailPrintDis",this.check).then((res) => {
  852. this.$endLoading();
  853. this.$refs.preView.show(this.hiprintTemplate, this.outputData);
  854. });
  855. }
  856. },
  857. // 关闭弹窗
  858. cancelDialogForm() {
  859. this.isShowDialog = false;
  860. this.$refs.dialogForm.resetFields();
  861. },
  862. // 提交 弹窗
  863. submitDialogForm() {
  864. this.$refs.dialogForm.validate((valid) => {
  865. if (valid) {
  866. let params = {
  867. shipId: this.queryItem[0].invoiceId,
  868. password: this.dialogForm.password,
  869. };
  870. checkPassword(params).then((res) => {
  871. this.getDateil(this.tableSelection, "getDtailPrintDis",this.check).then(
  872. (res) => {
  873. this.$endLoading();
  874. this.$refs.preView.show(this.hiprintTemplate, this.outputData);
  875. }
  876. );
  877. this.cancelDialogForm();
  878. });
  879. }
  880. });
  881. },
  882. },
  883. };
  884. </script>
  885. <style lang="scss" scoped>
  886. .main-title {
  887. display: flex;
  888. justify-content: space-between;
  889. align-items: center;
  890. height: 60px;
  891. border-bottom: 1px solid #dcdfe6;
  892. margin-bottom: 20px;
  893. .title {
  894. font-size: 16px;
  895. font-weight: 600;
  896. padding-left: 10px;
  897. }
  898. }
  899. .text {
  900. word-break: break-all !important;
  901. height: 200px;
  902. overflow-y: auto;
  903. }
  904. </style>