check.vue 30 KB

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