check.vue 15 KB

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