check.vue 28 KB

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