check.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  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="8" :lg="6">
  11. <el-form-item label="提货人手机号" prop="phone">
  12. <el-input v-model="screenForm.phone" placeholder="请输入提货人手机号"></el-input>
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :sm="3" :lg="3">
  16. <el-button size="mini" type="primary" @click="getCode" :disabled="!screenForm.phone || countDown != 60">{{countDown == 60 ? getCodeText : '重新获取('+countDown+'s)'}}</el-button>
  17. </el-col>
  18. <el-col :xs="24" :sm="8" :lg="8">
  19. <el-form-item label="验证码" prop="code">
  20. <el-input v-model="screenForm.code" placeholder="请输入验证码"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :xs="24" :sm="3" :lg="3">
  24. <el-button size="mini" type="primary" :disabled="!screenForm.phone || !screenForm.code" @click="getPickupManInfo">确 认</el-button>
  25. </el-col>
  26. </el-row>
  27. <el-row :gutter="20">
  28. <el-col :xs="24" :sm="11" :lg="9">
  29. <el-form-item label="提货人姓名" prop="name">
  30. <el-input v-model="screenForm.name" placeholder="请通过手机验证获取" readonly></el-input>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="8" :lg="8">
  34. <el-form-item label="提货人身份证" prop="idCard">
  35. <el-input v-model="screenForm.idCard" placeholder="请通过手机验证获取" readonly></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :xs="24" :sm="3" :lg="3">
  39. <el-button size="mini" type="primary" @click="getList">查 询</el-button>
  40. </el-col>
  41. </el-row>
  42. <el-row :gutter="20">
  43. <el-col :xs="24" :sm="24" :lg="24">
  44. <el-form-item prop="status" label-width="0">
  45. <el-radio-group v-model="screenForm.status" size="mini" @change="getList()">
  46. <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
  47. </el-radio-group>
  48. </el-form-item>
  49. </el-col>
  50. </el-row>
  51. </el-form>
  52. </div>
  53. <div class="main-title">
  54. <div class="title">提货单</div>
  55. <div class="fr">
  56. <ExportButton :exUrl="'pick/storeExport'" :exParams="exParams" />
  57. </div>
  58. </div>
  59. <div class="mymain-container">
  60. <div class="table">
  61. <el-table ref="table" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @select="handleSelect" @select-all="handleSelectAll">
  62. <el-table-column align="left" type="selection" width="55"></el-table-column>
  63. <!-- <el-table-column align="left" label="操作" width="100" fixed="left">
  64. <template slot-scope="scope">
  65. <el-button type="text" @click="toPrint(scope.row)">打印</el-button>
  66. </template>
  67. </el-table-column> -->
  68. <el-table-column align="left" label="状态" min-width="100" show-overflow-tooltip>
  69. <template slot-scope="scope">
  70. {{ scope.row.printNum ? '已打单(' + scope.row.printNum + ')' : '未打单' }}
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="120" show-overflow-tooltip>
  74. <template slot-scope="scope">
  75. <CopyButton :copyText="scope.row.informationKey" />
  76. <span>{{scope.row.informationKey}}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
  80. <template slot-scope="scope">
  81. <CopyButton :copyText="scope.row.customerNumber" />
  82. <span>{{scope.row.customerNumber}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
  86. <template slot-scope="scope">
  87. <CopyButton :copyText="scope.row.customerName" />
  88. <span>{{scope.row.customerName}}</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column align="left" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
  92. <template slot-scope="scope">
  93. {{ scope.row.pickTime | dateToDayFilter }}
  94. </template>
  95. </el-table-column>
  96. <el-table-column align="left" label="提货时段" min-width="100" show-overflow-tooltip>
  97. <template slot-scope="scope">
  98. {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
  99. </template>
  100. </el-table-column>
  101. <el-table-column align="left" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip>
  102. <template slot-scope="scope">
  103. <CopyButton :copyText="scope.row.orderType == 'HOME' ? scope.row.enginOrderNo: scope.row.mainOrderId" />
  104. <span>{{ scope.row.orderType == 'HOME' ? scope.row.enginOrderNo: scope.row.mainOrderId }}</span>
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="left" label="发货申请单号" prop="invoiceId" min-width="130" show-overflow-tooltip>
  108. <template slot-scope="scope">
  109. <CopyButton :copyText="scope.row.invoiceId" />
  110. <span>{{scope.row.invoiceId}}</span>
  111. </template>
  112. </el-table-column>
  113. <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
  114. <el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
  115. <template slot-scope="scope">
  116. <CopyButton :copyText="scope.row.materialCode" />
  117. <span>{{scope.row.materialCode}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
  121. <template slot-scope="scope">
  122. <CopyButton :copyText="scope.row.materialOldNumber" />
  123. <span>{{scope.row.materialOldNumber}}</span>
  124. </template>
  125. </el-table-column>
  126. <el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
  127. <template slot-scope="scope">
  128. <CopyButton :copyText="scope.row.materialName" />
  129. <span>{{scope.row.materialName}}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
  133. <template slot-scope="scope">
  134. <CopyButton :copyText="scope.row.specification" />
  135. <span>{{scope.row.specification}}</span>
  136. </template>
  137. </el-table-column>
  138. <el-table-column align="left" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
  139. <el-table-column align="left" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
  140. <!-- <el-table-column align="left" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
  141. <el-table-column align="left" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
  142. <el-table-column align="left" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
  143. <el-table-column align="left" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column> -->
  144. <el-table-column align="left" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
  145. <el-table-column align="left" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
  146. <template slot-scope="scope">
  147. {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
  148. </template>
  149. </el-table-column>
  150. <el-table-column align="left" label="提货人/物流公司" prop="takerName" min-width="160" show-overflow-tooltip>
  151. <template slot-scope="scope">
  152. {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. </div>
  157. </div>
  158. <!-- <div class="pagination clearfix">
  159. <div class="fr">
  160. <el-pagination
  161. @size-change="handleSizeChange"
  162. @current-change="handleCurrentChange"
  163. :current-page="currentPage"
  164. :page-sizes="[10, 20, 30, 50]"
  165. :page-size="10"
  166. layout="total, sizes, prev, pager, next, jumper"
  167. :total="listTotal">
  168. </el-pagination>
  169. </div>
  170. </div> -->
  171. <div class="page-footer">
  172. <div class="footer">
  173. <el-button type="primary" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单</el-button>
  174. </div>
  175. </div>
  176. </div>
  177. <el-dialog title="密码确认" :visible.sync="isShowDialog" :show-close="false" width="40%" :close-on-click-modal="false">
  178. <el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="right" label-width="70px">
  179. <el-row :gutter="20">
  180. <el-col :xs="24" :sm="24" :lg="24">
  181. <el-form-item label="密码" prop="password">
  182. <el-input v-model="dialogForm.password" autocomplete="off" placeholder="请输入密码"></el-input>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :xs="24" :sm="12" :lg="12">
  186. <el-form-item label="操作人" prop="createMan">
  187. <el-input v-model="dialogForm.createMan" readonly></el-input>
  188. </el-form-item>
  189. </el-col>
  190. <el-col :xs="24" :sm="12" :lg="12" style="height: 51px;">
  191. <el-form-item label="操作日期" prop="createDate">
  192. <el-date-picker v-model="dialogForm.createDate" readonly type="date" value-format="yyyy-MM-dd" style="width: 100%;" placeholder="选择日期">
  193. </el-date-picker>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. </el-form>
  198. <div slot="footer" class="dialog-footer">
  199. <el-button @click="cancelDialogForm">取 消</el-button>
  200. <el-button type="primary" @click="submitDialogForm">确 定</el-button>
  201. </div>
  202. </el-dialog>
  203. <PickupPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
  204. </div>
  205. </template>
  206. <script>
  207. import {
  208. getPickupList,
  209. getCode,
  210. getPickupManInfo,
  211. checkPassword,
  212. } from "@/api/supply/pickup";
  213. import PickupPrint from "@/views/supply/pickup/components/pickup_print";
  214. export default {
  215. components: {
  216. PickupPrint,
  217. },
  218. data() {
  219. return {
  220. currentPage: 1, // 当前页码
  221. pageSize: 10, // 每页数量
  222. listTotal: 0, // 列表总数
  223. dataList: null, // 列表数据
  224. listLoading: false, // 列表加载loading
  225. screenForm: {
  226. // 筛选表单数据
  227. phone: "",
  228. code: "",
  229. name: "",
  230. idCard: "",
  231. manId: "",
  232. status: 0,
  233. },
  234. statusList: [
  235. { label: "未打单", value: 0 },
  236. { label: "已打单", value: 1 },
  237. ],
  238. getCodeText: "获取验证码",
  239. countDown: 60,
  240. timer: null,
  241. tableSelection: [],
  242. queryItem: {},
  243. isShowPrint: false,
  244. isShowDialog: false,
  245. dialogForm: {
  246. password: "",
  247. createMan: "",
  248. createDate: "",
  249. },
  250. dialogFormRules: {
  251. password: [{ required: true, message: "请输入密码", trigger: "blur" }],
  252. },
  253. };
  254. },
  255. computed: {
  256. exParams() {
  257. return {
  258. takerId: this.screenForm.manId,
  259. status: this.screenForm.status,
  260. };
  261. },
  262. },
  263. created() {},
  264. methods: {
  265. getDate() {
  266. var date = new Date();
  267. var seperator1 = "-";
  268. var year = date.getFullYear();
  269. var month = date.getMonth() + 1;
  270. var strDate = date.getDate();
  271. if (month >= 1 && month <= 9) {
  272. month = "0" + month;
  273. }
  274. if (strDate >= 0 && strDate <= 9) {
  275. strDate = "0" + strDate;
  276. }
  277. var currentdate = year + seperator1 + month + seperator1 + strDate;
  278. return currentdate;
  279. },
  280. // 获取短信验证码
  281. getCode() {
  282. getCode({ mobile: this.screenForm.phone }).then((res) => {
  283. this.$successMsg("短信已发送");
  284. this.countDown--;
  285. this.timer = setInterval(() => {
  286. this.countDown--;
  287. if (this.countDown == 0) {
  288. this.countDown = 60;
  289. this.getCodeText = "重新获取";
  290. clearInterval(this.timer);
  291. }
  292. }, 1000);
  293. });
  294. },
  295. // 获取提货人信息
  296. getPickupManInfo() {
  297. getPickupManInfo({
  298. mobile: this.screenForm.phone,
  299. code: this.screenForm.code,
  300. }).then((res) => {
  301. this.$successMsg("验证成功");
  302. this.screenForm.name = res.data.takerName;
  303. this.screenForm.idCard = res.data.identity;
  304. this.screenForm.manId = res.data.id;
  305. });
  306. },
  307. // 查询列表
  308. getList() {
  309. if (!this.screenForm.manId) {
  310. return this.$errorMsg("请先查询提货人信息");
  311. }
  312. this.listLoading = true;
  313. let params = {
  314. pageNum: 1,
  315. pageSize: -1,
  316. takerId: this.screenForm.manId,
  317. status: this.screenForm.status,
  318. takerPhone: this.screenForm.phone,
  319. };
  320. getPickupList(params).then((res) => {
  321. this.dataList = res.data.records;
  322. this.listTotal = res.data.total;
  323. this.listLoading = false;
  324. });
  325. },
  326. // 更改每页数量
  327. handleSizeChange(val) {
  328. this.pageSize = val;
  329. this.currentPage = 1;
  330. this.getList();
  331. },
  332. // 更改当前页
  333. handleCurrentChange(val) {
  334. this.currentPage = val;
  335. this.getList();
  336. },
  337. backList() {
  338. this.queryItem = {};
  339. this.isShowPrint = false;
  340. },
  341. handleSelect(selection, row) {
  342. this.$refs.table.toggleRowSelection(row);
  343. this.dataList.forEach((item) => {
  344. if (item.informationKey === row.informationKey) {
  345. this.$refs.table.toggleRowSelection(item);
  346. }
  347. });
  348. this.tableSelection = this.$refs.table.selection;
  349. },
  350. handleSelectAll(selection) {
  351. this.tableSelection = this.$refs.table.selection;
  352. },
  353. // 检查是否一致
  354. isAllEqual(array) {
  355. if (array.length > 0) {
  356. return !array.some(function (item, index) {
  357. return item.informationKey !== array[0].informationKey;
  358. });
  359. } else {
  360. return true;
  361. }
  362. },
  363. // 点击打印
  364. toPrint() {
  365. if (!this.isAllEqual(this.tableSelection)) {
  366. return this.$errorMsg("只能选择同一个提货订单");
  367. }
  368. if (!this.tableSelection[0].printNum) {
  369. this.queryItem = this.tableSelection;
  370. this.isShowPrint = true;
  371. } else {
  372. this.queryItem = this.tableSelection;
  373. this.dialogForm.createMan = JSON.parse(
  374. localStorage.getItem("supply_user")
  375. ).nickName;
  376. this.dialogForm.createDate = this.getDate();
  377. this.isShowDialog = true;
  378. }
  379. },
  380. // 点击打印
  381. // toPrint(item) {
  382. // if(!item.printNum) {
  383. // this.queryItem = item;
  384. // this.isShowPrint = true;
  385. // }else {
  386. // this.queryItem = item;
  387. // this.dialogForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
  388. // this.dialogForm.createDate = this.getDate();
  389. // this.isShowDialog = true;
  390. // }
  391. // },
  392. // 关闭弹窗
  393. cancelDialogForm() {
  394. this.isShowDialog = false;
  395. this.$refs.dialogForm.resetFields();
  396. },
  397. // 提交 弹窗
  398. submitDialogForm() {
  399. this.$refs.dialogForm.validate((valid) => {
  400. if (valid) {
  401. let params = {
  402. shipId: this.queryItem[0].invoiceId,
  403. password: this.dialogForm.password,
  404. };
  405. checkPassword(params).then((res) => {
  406. this.cancelDialogForm();
  407. this.isShowPrint = true;
  408. });
  409. }
  410. });
  411. },
  412. },
  413. };
  414. </script>
  415. <style lang="scss" scoped>
  416. .main-title {
  417. display: flex;
  418. justify-content: space-between;
  419. align-items: center;
  420. height: 60px;
  421. border-bottom: 1px solid #dcdfe6;
  422. margin-bottom: 20px;
  423. .title {
  424. font-size: 16px;
  425. font-weight: 600;
  426. padding-left: 10px;
  427. }
  428. }
  429. </style>