check.vue 28 KB

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