check.vue 31 KB

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