check.vue 15 KB

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