check.vue 14 KB

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