123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418 |
- <template>
- <div class="app-container">
-
- <div v-show="!isShowPrint">
- <div class="main-title">
- <div class="title">仓库提货确认</div>
- </div>
- <div>
- <el-form ref="screenForm" :model="screenForm" label-width="96px" size="small" label-position="right">
- <el-row :gutter="20">
- <el-col :xs="24" :sm="8" :lg="6">
- <el-form-item label="提货人手机号" prop="phone">
- <el-input v-model="screenForm.phone" placeholder="请输入提货人手机号"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="3" :lg="3">
- <el-button size="small" type="primary" @click="getCode" :disabled="!screenForm.phone || countDown != 60">{{countDown == 60 ? getCodeText : '重新获取('+countDown+'s)'}}</el-button>
- </el-col>
- <el-col :xs="24" :sm="8" :lg="8">
- <el-form-item label="验证码" prop="code">
- <el-input v-model="screenForm.code" placeholder="请输入验证码"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="3" :lg="3">
- <el-button size="small" type="primary" :disabled="!screenForm.phone || !screenForm.code" @click="getPickupManInfo">确 认</el-button>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :xs="24" :sm="11" :lg="9">
- <el-form-item label="提货人姓名" prop="name">
- <el-input v-model="screenForm.name" placeholder="请通过手机验证获取" readonly></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="8" :lg="8">
- <el-form-item label="提货人身份证" prop="idCard">
- <el-input v-model="screenForm.idCard" placeholder="请通过手机验证获取" readonly></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="3" :lg="3">
- <el-button size="small" type="primary" @click="getList">查 询</el-button>
- </el-col>
- </el-row>
- <el-row :gutter="20">
- <el-col :xs="24" :sm="24" :lg="24">
- <el-form-item prop="status" label-width="0">
- <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
- <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="main-title">
- <div class="title">提货单</div>
- <div class="fr">
- <ExportButton :exUrl="'pick/storeExport'" :exParams="exParams" />
- </div>
- </div>
- <div class="mymain-container">
- <div class="table">
- <el-table ref="table" v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @select="handleSelect" @select-all="handleSelectAll">
- <el-table-column align="center" type="selection" width="55"></el-table-column>
- <!-- <el-table-column align="center" label="操作" width="100" fixed="left">
- <template slot-scope="scope">
- <el-button type="text" @click="toPrint(scope.row)">打印</el-button>
- </template>
- </el-table-column> -->
- <el-table-column align="center" label="状态" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.printNum ? '已打单(' + scope.row.printNum + ')' : '未打单' }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="信息密钥" prop="informationKey" min-width="180" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="预约日期" prop="pickTime" min-width="120" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.pickTime | dateToDayFilter }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="提货时段" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.pickStatus == '1' ? '上午':'下午' }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="销售订单号" prop="mainOrderId" min-width="200" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="发货申请单号" prop="invoiceId" min-width="180" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
- <!-- <el-table-column align="center" label="产品大类" prop="mainName" min-width="120" show-overflow-tooltip></el-table-column> -->
- <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="使用返利金额" prop="payRebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="格力折扣" prop="totalDiscAmount" min-width="100" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" show-overflow-tooltip></el-table-column>
- <el-table-column align="center" label="提货方式" prop="pickType" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.pickType == '1' ? '自提':'物流快递' }}
- </template>
- </el-table-column>
- <el-table-column align="center" label="提货人/物流公司" prop="takerName" min-width="160" show-overflow-tooltip>
- <template slot-scope="scope">
- {{ scope.row.pickType == '1' ? scope.row.takerName:scope.row.pickLogistics }}
- </template>
- </el-table-column>
- </el-table>
- </div>
- </div>
- <!-- <div class="pagination clearfix">
- <div class="fr">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="10"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal">
- </el-pagination>
- </div>
- </div> -->
- <div class="page-footer">
- <div class="footer">
- <el-button type="primary" @click="toPrint" :disabled="tableSelection.length < 1">打印发货单</el-button>
- </div>
- </div>
- </div>
- <el-dialog title="密码确认" :visible.sync="isShowDialog" :show-close="false" width="40%" :close-on-click-modal="false">
- <el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="right" label-width="70px">
- <el-row :gutter="20">
- <el-col :xs="24" :sm="24" :lg="24">
- <el-form-item label="密码" prop="password">
- <el-input v-model="dialogForm.password" autocomplete="off" placeholder="请输入密码"></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="12">
- <el-form-item label="操作人" prop="createMan">
- <el-input v-model="dialogForm.createMan" readonly></el-input>
- </el-form-item>
- </el-col>
- <el-col :xs="24" :sm="12" :lg="12" style="height: 51px;">
- <el-form-item label="操作日期" prop="createDate">
- <el-date-picker
- v-model="dialogForm.createDate"
- readonly
- type="date"
- value-format="yyyy-MM-dd"
- style="width: 100%;"
- placeholder="选择日期">
- </el-date-picker>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="cancelDialogForm">取 消</el-button>
- <el-button type="primary" @click="submitDialogForm">确 定</el-button>
- </div>
- </el-dialog>
- <PickupPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
- </div>
- </template>
- <script>
- import { getPickupList, getCode, getPickupManInfo, checkPassword } from "@/api/supply/pickup";
- import PickupPrint from "@/views/supply/pickup/components/pickup_print";
- export default {
- components: {
- PickupPrint
- },
- data() {
- return {
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表总数
- dataList: null, // 列表数据
- listLoading: false, // 列表加载loading
- screenForm: { // 筛选表单数据
- phone: '',
- code: '',
- name: '',
- idCard: '',
- manId: '',
- status: 0,
- },
- statusList: [
- { label: '未打单', value: 0 },
- { label: '已打单', value: 1 },
- ],
- getCodeText: '获取验证码',
- countDown: 60,
- timer: null,
- tableSelection: [],
- queryItem: {},
- isShowPrint: false,
- isShowDialog: false,
- dialogForm: {
- password: '',
- createMan: '',
- createDate: '',
- },
- dialogFormRules: {
- password: [
- { required: true, message: '请输入密码', trigger: 'blur' }
- ],
- },
- }
- },
- computed: {
- exParams() {
- return {
- takerId: this.screenForm.manId,
- status: this.screenForm.status,
- }
- },
- },
- created() {
-
- },
- methods: {
- getDate() {
- var date = new Date();
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = year + seperator1 + month + seperator1 + strDate;
- return currentdate;
- },
- // 获取短信验证码
- getCode() {
- getCode({mobile: this.screenForm.phone}).then(res => {
- this.$successMsg('短信已发送');
- this.countDown--;
- this.timer = setInterval(() => {
- this.countDown--;
- if (this.countDown == 0) {
- this.countDown = 60;
- this.getCodeText = '重新获取';
- clearInterval(this.timer)
- }
- }, 1000)
- })
- },
- // 获取提货人信息
- getPickupManInfo() {
- getPickupManInfo({
- mobile: this.screenForm.phone,
- code: this.screenForm.code,
- }).then(res => {
- this.$successMsg('验证成功');
- this.screenForm.name = res.data.takerName;
- this.screenForm.idCard = res.data.identity;
- this.screenForm.manId = res.data.id;
- })
- },
- // 查询列表
- getList() {
- if(!this.screenForm.manId) {
- return this.$errorMsg('请先查询提货人信息');
- }
- this.listLoading = true;
- let params = {
- pageNum: 1,
- pageSize: -1,
- takerId: this.screenForm.manId,
- status: this.screenForm.status,
- };
- getPickupList(params).then((res) => {
- this.dataList = res.data.records;
- this.listTotal = res.data.total;
- this.listLoading = false;
- })
- },
- // 更改每页数量
- handleSizeChange(val) {
- this.pageSize = val;
- this.currentPage = 1;
- this.getList();
- },
- // 更改当前页
- handleCurrentChange(val) {
- this.currentPage = val;
- this.getList();
- },
- backList() {
- this.queryItem = {};
- this.isShowPrint = false;
- },
- handleSelect(selection, row) {
- this.$refs.table.toggleRowSelection(row);
- this.dataList.forEach(item => {
- if (item.informationKey === row.informationKey) {
- this.$refs.table.toggleRowSelection(item);
- }
- })
- this.tableSelection = this.$refs.table.selection;
- },
- handleSelectAll(selection) {
- this.tableSelection = this.$refs.table.selection;
- },
- // 检查是否一致
- isAllEqual(array) {
- if (array.length > 0) {
- return !array.some(function(item, index) {
- return item.informationKey !== array[0].informationKey;
- });
- } else {
- return true;
- }
- },
- // 点击打印
- toPrint() {
- if(!this.isAllEqual(this.tableSelection)) {
- return this.$errorMsg('只能选择同一个提货订单');
- }
- if(!this.tableSelection[0].printNum) {
- this.queryItem = this.tableSelection;
- this.isShowPrint = true;
- }else {
- this.queryItem = this.tableSelection;
- this.dialogForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
- this.dialogForm.createDate = this.getDate();
- this.isShowDialog = true;
- }
- },
- // 点击打印
- // toPrint(item) {
- // if(!item.printNum) {
- // this.queryItem = item;
- // this.isShowPrint = true;
- // }else {
- // this.queryItem = item;
- // this.dialogForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
- // this.dialogForm.createDate = this.getDate();
- // this.isShowDialog = true;
- // }
- // },
- // 关闭弹窗
- cancelDialogForm(){
- this.isShowDialog = false;
- this.$refs.dialogForm.resetFields();
- },
- // 提交 弹窗
- submitDialogForm() {
- this.$refs.dialogForm.validate((valid) => {
- if (valid) {
- let params = {
- shipId: this.queryItem[0].invoiceId,
- password: this.dialogForm.password
- }
- checkPassword(params).then(res => {
- this.cancelDialogForm();
- this.isShowPrint = true;
- })
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .main-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 60px;
- border-bottom: 1px solid #DCDFE6;
- margin-bottom: 20px;
- .title {
- font-size: 16px;
- font-weight: 600;
- padding-left: 10px;
- }
- }
- </style>
|