|
@@ -15,22 +15,49 @@
|
|
|
</pagination>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="60%" :close-on-click-modal="false"
|
|
|
+ <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="80%" :close-on-click-modal="false"
|
|
|
@close="closePopup">
|
|
|
<div class="card_waybill">
|
|
|
<div class="waybill_item" style="margin-right: 10px;">
|
|
|
- <waybillForm ref="sender" title="寄件人" :ruleForm="senderForm" @addressBook="getAddressBook('sender')">
|
|
|
+ <waybillForm ref="sender" title="寄件人" :conserveFlag="conserveFlag" thinTitle="寄件人簿" :ruleForm="senderForm"
|
|
|
+ @addressBook="getAddressBook('sender')" @conserveSelect="conserveSelect">
|
|
|
</waybillForm>
|
|
|
</div>
|
|
|
<div class="waybill_item" style="margin-left: 10px;">
|
|
|
- <waybillForm ref="recipients" title="收件人" :ruleForm="recipientsForm"
|
|
|
- @addressBook="getAddressBook('consignee')"></waybillForm>
|
|
|
+ <waybillForm ref="deliverer" title="配送人" :ruleForm="delivererForm" :deliverer="true"
|
|
|
+ @addressBook="getDelivererBook('deliverer')"></waybillForm>
|
|
|
+ </div>
|
|
|
+ <div class="waybill_item" style="margin-left: 10px;">
|
|
|
+ <waybillForm ref="recipients" title="收件人" :conserveFlag="conserveFlag" thinTitle="收件人簿"
|
|
|
+ :ruleForm="recipientsForm" @addressBook="getAddressBook('recipients')" @conserveSelect="conserveSelectil">
|
|
|
+ </waybillForm>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin-top: 20px;">
|
|
|
<forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="80px">
|
|
|
</forms>
|
|
|
</div>
|
|
|
+ <el-dialog width="60%" title="地址簿" :visible.sync="innerVisible" append-to-body>
|
|
|
+ <div class="space_between_in" style="margin-bottom: 15px;">
|
|
|
+ <div style="display: flex;align-items: center;width: 100%;">
|
|
|
+ <h3 style="margin-left: 10px;flex: none;">搜索:</h3>
|
|
|
+ <el-input v-model="bookInput" style="width: 100%;" placeholder="请输入姓名、电话、地址快速查找"
|
|
|
+ @input="fastSearch()"></el-input>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="card_book_list">
|
|
|
+ <!-- 表单 -->
|
|
|
+ <tables :suspension="true" :tableList="bookTableList" :tableData="bookTableData" @cellClick="cellClick"
|
|
|
+ @buttonData="buttonData">
|
|
|
+ </tables>
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div v-if="bookTotal">
|
|
|
+ <pagination :total="bookTotal" :currentPage="bookPagination.PageIndex" @changeSize="bookChangeSize"
|
|
|
+ @changeCurrent="bookChangeCurrent">
|
|
|
+ </pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button plain @click="staffDialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
|
|
@@ -57,10 +84,6 @@
|
|
|
</el-dialog>
|
|
|
<orderDetails ref="order" :waybillData="waybillData"></orderDetails>
|
|
|
<el-dialog title="批量导入" :visible.sync="bulkImportVisible" width="600px" @close="closeDialog2">
|
|
|
- <div class="card_customer">
|
|
|
- <span>下单客户</span>
|
|
|
- <el-input v-model="orderCustomer" placeholder="请输入内容"></el-input>
|
|
|
- </div>
|
|
|
<div class="card_bulkImport">
|
|
|
<el-upload ref="mYupload" class="upload-demo" accept=".xls,.xlsx" drag action="#" :limit="1" multiple
|
|
|
:http-request="UploadImage">
|
|
@@ -91,11 +114,17 @@
|
|
|
getReceipt
|
|
|
} from '@/api/waybill'
|
|
|
import {
|
|
|
+ getAddress,
|
|
|
addAddress,
|
|
|
+ putAddress,
|
|
|
+ delAddress
|
|
|
} from '@/api/address'
|
|
|
import {
|
|
|
getCoolerBox
|
|
|
} from '@/api/incubator.js'
|
|
|
+ import {
|
|
|
+ getUser
|
|
|
+ } from '@/api/user'
|
|
|
import actionBar from '@/components/actionBar'
|
|
|
import tables from '@/components/tables'
|
|
|
import pagination from '@/components/pagination'
|
|
@@ -107,7 +136,8 @@
|
|
|
employee,
|
|
|
addressBook,
|
|
|
sendList,
|
|
|
- signList
|
|
|
+ signList,
|
|
|
+ addressDeliverer
|
|
|
} from "./waybill.js";
|
|
|
import {
|
|
|
WaybillStatus
|
|
@@ -168,6 +198,11 @@
|
|
|
PageSize: 10,
|
|
|
},
|
|
|
Total: 0,
|
|
|
+ bookPagination: {
|
|
|
+ PageIndex: 1,
|
|
|
+ PageSize: 10,
|
|
|
+ },
|
|
|
+ bookTotal: 0,
|
|
|
tableData: [],
|
|
|
operationType: '',
|
|
|
tableList: employee(),
|
|
@@ -186,26 +221,15 @@
|
|
|
region: '',
|
|
|
address: '',
|
|
|
},
|
|
|
- bookList: {
|
|
|
- field: 'action',
|
|
|
- label: '操作',
|
|
|
- align: 'center',
|
|
|
- labelButton: [{
|
|
|
- type: 'edit',
|
|
|
- label: '编辑',
|
|
|
- icon: 'el-icon-edit',
|
|
|
- style: 'primary',
|
|
|
- }, {
|
|
|
- type: 'del',
|
|
|
- label: '删除',
|
|
|
- icon: 'el-icon-delete',
|
|
|
- style: 'danger',
|
|
|
- }]
|
|
|
+ delivererForm: {
|
|
|
+ name: '',
|
|
|
+ phone: '',
|
|
|
},
|
|
|
ruleForm: {
|
|
|
tamperProofLabel: '',
|
|
|
tamperProofLabelImg: '',
|
|
|
remark: '',
|
|
|
+ fileList: [],
|
|
|
},
|
|
|
formRuleList: [],
|
|
|
bookType: '',
|
|
@@ -222,7 +246,6 @@
|
|
|
importFlag: false,
|
|
|
downloadFlag: false,
|
|
|
importFile: null,
|
|
|
- orderCustomer: '',
|
|
|
page: 1,
|
|
|
staffName: '',
|
|
|
limitNo: true,
|
|
@@ -236,6 +259,15 @@
|
|
|
},
|
|
|
signConfirmLoading: false,
|
|
|
waybillNo: '',
|
|
|
+ innerVisible: false,
|
|
|
+ tabPosition: 'my',
|
|
|
+ bookInput: '',
|
|
|
+ bookTableList: [],
|
|
|
+ bookTableData: [],
|
|
|
+ bookTotal: 0,
|
|
|
+ saveSenderAddress: true,
|
|
|
+ saveConsigneeAddress: true,
|
|
|
+ conserveFlag: true,
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -269,11 +301,74 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 获取地址簿
|
|
|
+ getAddressBook(type) {
|
|
|
+ this.bookTableList = addressBook()
|
|
|
+ this.bookType = type
|
|
|
+ this.innerVisible = true
|
|
|
+ this.getSenderSend()
|
|
|
+ },
|
|
|
+ // 获取寄/收列表
|
|
|
+ getSenderSend() {
|
|
|
+ let address = ''
|
|
|
+ if (this.bookType == 'recipients') {
|
|
|
+ address = 'consignee'
|
|
|
+ } else {
|
|
|
+ address = this.bookType
|
|
|
+ }
|
|
|
+ getAddress({
|
|
|
+ page: this.bookPagination.PageIndex,
|
|
|
+ pageSize: this.bookPagination.PageSize,
|
|
|
+ name: this.bookInput,
|
|
|
+ addressType: address,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.bookTableData = res.data.list
|
|
|
+ this.bookTotal = res.data.count
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取配送人
|
|
|
+ getDelivererBook(type) {
|
|
|
+ this.innerVisible = true
|
|
|
+ this.bookType = type
|
|
|
+ this.bookTableList = addressDeliverer()
|
|
|
+ this.getDelivererList()
|
|
|
+ },
|
|
|
+ getDelivererList() {
|
|
|
+ var params = {
|
|
|
+ page: this.bookPagination.PageIndex,
|
|
|
+ pageSize: this.bookPagination.PageSize,
|
|
|
+ type: 3,
|
|
|
+ name: this.bookInput,
|
|
|
+ }
|
|
|
+ getUser(params).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.bookTableData = res.data.list
|
|
|
+ this.bookTotal = res.data.count
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 选择是否保存
|
|
|
+ conserveSelect(type) {
|
|
|
+ if (type) {
|
|
|
+ this.saveSenderAddress = true
|
|
|
+ } else {
|
|
|
+ this.saveSenderAddress = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ conserveSelectil(type) {
|
|
|
+ if (type) {
|
|
|
+ this.saveConsigneeAddress = true
|
|
|
+ } else {
|
|
|
+ this.saveConsigneeAddress = false
|
|
|
+ }
|
|
|
+ },
|
|
|
// 弹窗表单添加
|
|
|
async handleAdd() {
|
|
|
let senderFlag = this.$refs['sender'].validateForm();
|
|
|
let recipientsFlag = this.$refs['recipients'].validateForm();
|
|
|
- let flag = this.$refs['childRules'].validateForm();
|
|
|
+ let flag = this.$refs['deliverer'].validateForm();
|
|
|
if (senderFlag && recipientsFlag && flag) {
|
|
|
this.confirmLoading = true
|
|
|
var params = {
|
|
@@ -283,10 +378,16 @@
|
|
|
consigneeAddressName: this.recipientsForm.name,
|
|
|
consigneeAddressPhone: this.recipientsForm.phone,
|
|
|
consigneeAddressDetails: this.recipientsForm.address,
|
|
|
+ deliveryName: this.delivererForm.name,
|
|
|
+ deliveryPhone: this.delivererForm.phone,
|
|
|
+ saveSenderAddress: this.saveSenderAddress,
|
|
|
+ saveConsigneeAddress: this.saveConsigneeAddress,
|
|
|
...this.ruleForm
|
|
|
}
|
|
|
- var fileImage = this.picture(this.ruleForm.fileList)
|
|
|
- params.tamperProofLabelImg = fileImage
|
|
|
+ if (this.ruleForm.fileList) {
|
|
|
+ var fileImage = this.picture(this.ruleForm.fileList)
|
|
|
+ params.tamperProofLabelImg = fileImage
|
|
|
+ }
|
|
|
if (this.operationType == 'add') {
|
|
|
await addWaybill(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -384,6 +485,34 @@
|
|
|
})
|
|
|
});
|
|
|
},
|
|
|
+ // 选择table其中某一项
|
|
|
+ cellClick(row) {
|
|
|
+ this.innerVisible = false
|
|
|
+ const param = {
|
|
|
+ ...row
|
|
|
+ }
|
|
|
+ if (this.bookType == 'sender') {
|
|
|
+ this.senderForm = param
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.sender.radio = ''
|
|
|
+ // this.$refs['sender'].clickitem('1')
|
|
|
+ this.$refs['sender'].validateForm();
|
|
|
+ })
|
|
|
+ } else if (this.bookType == 'recipients') {
|
|
|
+ this.recipientsForm = param
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.recipients.radio = ''
|
|
|
+ // this.$refs['recipients'].clickitem('1')
|
|
|
+ this.$refs['recipients'].validateForm();
|
|
|
+ })
|
|
|
+ } else if (this.bookType == 'deliverer') {
|
|
|
+ this.delivererForm.name = param.nickName
|
|
|
+ this.delivererForm.phone = param.phone
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['deliverer'].validateForm();
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
buttonData(row, type) {
|
|
|
this.operationType = type
|
|
|
this.orderId = row.id
|
|
@@ -392,6 +521,7 @@
|
|
|
this.waybillData = row
|
|
|
this.waybillData.coolerBoxName = row.coolerBox.name
|
|
|
} else if (type == 'edit') {
|
|
|
+ this.conserveFlag = false
|
|
|
this.staffTitle = '编辑'
|
|
|
this.staffDialogVisible = true
|
|
|
setTimeout(() => {
|
|
@@ -402,6 +532,8 @@
|
|
|
this.recipientsForm.name = row.consigneeAddressName
|
|
|
this.recipientsForm.phone = row.consigneeAddressPhone
|
|
|
this.recipientsForm.address = row.consigneeAddressDetails
|
|
|
+ this.delivererForm.name = row.deliveryName
|
|
|
+ this.delivererForm.phone = row.deliveryPhone
|
|
|
this.ruleForm.tamperProofLabel = row.tamperProofLabel
|
|
|
if (row.tamperProofLabelImg) {
|
|
|
var arr = row.tamperProofLabelImg.split(',')
|
|
@@ -583,8 +715,13 @@
|
|
|
openModel(type) {
|
|
|
this.operationType = type
|
|
|
if (type == 'add') {
|
|
|
+ this.conserveFlag = true
|
|
|
this.staffTitle = '添加运单'
|
|
|
this.staffDialogVisible = true
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.sender.radio = '1'
|
|
|
+ this.$refs.recipients.radio = '1'
|
|
|
+ })
|
|
|
} else if (type == 'sends') {
|
|
|
const arrID = this.$refs.refWaybill.waybillIds
|
|
|
if (arrID.length != 0) {
|
|
@@ -644,7 +781,6 @@
|
|
|
this.importFlag = true
|
|
|
let formData = new FormData();
|
|
|
formData.append('file', this.importFile);
|
|
|
- formData.append('customerName', this.orderCustomer);
|
|
|
waybillImport(formData).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.bulkImportVisible = false
|
|
@@ -691,28 +827,6 @@
|
|
|
anchor.click();
|
|
|
window.URL.revokeObjectURL(data);
|
|
|
},
|
|
|
- getCodeToText(codeArray) {
|
|
|
- let area = "";
|
|
|
- switch (codeArray.length) {
|
|
|
- case 1:
|
|
|
- area += CodeToText[codeArray[0]];
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- area += CodeToText[codeArray[0]] + "/" + CodeToText[codeArray[1]];
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- area +=
|
|
|
- CodeToText[codeArray[0]] +
|
|
|
- "/" +
|
|
|
- CodeToText[codeArray[1]] +
|
|
|
- "/" +
|
|
|
- CodeToText[codeArray[2]];
|
|
|
- break;
|
|
|
- default:
|
|
|
- break;
|
|
|
- }
|
|
|
- return area
|
|
|
- },
|
|
|
changeSize(val) {
|
|
|
this.Pagination.PageSize = val
|
|
|
this.getList()
|
|
@@ -721,6 +835,30 @@
|
|
|
this.Pagination.PageIndex = val
|
|
|
this.getList()
|
|
|
},
|
|
|
+ // 地址簿
|
|
|
+ bookChangeSize(val) {
|
|
|
+ this.bookPagination.PageSize = val
|
|
|
+ if (this.bookType == 'deliverer') {
|
|
|
+ this.getDelivererList()
|
|
|
+ } else {
|
|
|
+ this.getSenderSend()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ bookChangeCurrent(val) {
|
|
|
+ this.bookPagination.PageIndex = val
|
|
|
+ if (this.bookType == 'deliverer') {
|
|
|
+ this.getDelivererList()
|
|
|
+ } else {
|
|
|
+ this.getSenderSend()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 快速搜索
|
|
|
+ fastSearch() {
|
|
|
+ this.bookPagination.PageIndex = 1
|
|
|
+ if (this.bookType == 'deliverer') {
|
|
|
+ this.getDelivererList()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 清空表单
|
|
|
closeDialog() {
|
|
|
this.$refs.sendRules.resetCheck();
|
|
@@ -738,6 +876,7 @@
|
|
|
this.ruleForm.fileList = []
|
|
|
this.$refs.sender.resetForm()
|
|
|
this.$refs.recipients.resetForm()
|
|
|
+ this.$refs.deliverer.resetForm()
|
|
|
this.$refs.childRules.resetCheck()
|
|
|
}
|
|
|
}
|