Browse Source

新增功能及修改项、验收0605

qianduan 8 months ago
parent
commit
82c0f394d2

+ 0 - 7
src/api/address.js

@@ -8,13 +8,6 @@ export function getAddress(parameter) {
     params: parameter
   })
 }
-// 获取地址详情
-export function getAddressDetails(parameter) {
-  return request({
-    url: '/api/address' + parameter,
-    method: 'get',
-  })
-}
 
 // 添加地址
 export function addAddress(parameter) {

+ 8 - 0
src/api/waybill.js

@@ -59,6 +59,14 @@ export function getReceipt(parameter) {
     data: parameter
   })
 }
+// 公共页面签收
+export function getCustomerReceipt(parameter) {
+  return request({
+    url: '/api/waybill/customer/receipt',
+    method: 'post',
+    data: parameter
+  })
+}
 
 // 批量导入运单
 export function waybillImport(parameter) {

+ 19 - 6
src/assets/js/blockSort.js

@@ -1,15 +1,14 @@
 export const orderStatus = () => {
   return [{
-      label: '仓管',
+      label: '管理员',
+      value: 1,
+    }, {
+      label: '门店管理员',
       value: 2,
     },
     {
-      label: '司机',
+      label: '配送员',
       value: 3,
-    },
-    {
-      label: '管理员',
-      value: 1,
     }
   ]
 }
@@ -74,3 +73,17 @@ export const startStatus = () => {
     }
   ]
 }
+
+export const userType = () => {
+  return [{
+      bgcolor: '#409EFF',
+      label: '发货人',
+      value: 'sender',
+    },
+    {
+      bgcolor: '#19be6b',
+      label: '收件人',
+      value: 'consignee',
+    }
+  ]
+}

+ 1 - 2
src/components/forms.vue

@@ -236,9 +236,8 @@
           if (res.code == 200) {
             let arr1 = {
               uid: this.file.uid,
-              url: '',
+              url: res.data,
             }
-            arr1.url = res.data
             this.ruleForm.fileList.push(arr1)
           }
           loading.close();

+ 10 - 2
src/components/orderDetails.vue

@@ -104,16 +104,24 @@
           field: 'consigneeAddressDetails',
           colWidth: 8,
         }, {
+          title: '配送员姓名:',
+          field: 'deliveryName',
+          colWidth: 8,
+        }, {
+          title: '配送员电话:',
+          field: 'deliveryPhone',
+          colWidth: 8,
+        }, {
           title: '下单时间:',
           field: 'orderTime',
           colWidth: 8,
         }, {
           title: '配送时间:',
-          field: 'receiptTime',
+          field: 'deliveryTime',
           colWidth: 8,
         }, {
           title: '签收时间:',
-          field: 'receiptTime',
+          field: 'deliveryTime',
           colWidth: 8,
         }, {
           title: '防拆标签图片:',

+ 1 - 1
src/components/tables.vue

@@ -24,7 +24,7 @@
           </template>
         </el-table-column>
         <el-table-column :prop="item.field" :label="item.label" :width="item.colWidth" :align="item.align"
-          v-else-if="['userId', 'type', 'status', 'storeId', 'personCode', 'optType', 'corrosion', 'crackle', 'deform', 'damage', 'safeAnnex', 'gasPressure', 'bodyDeform', 'fillingLeak', 'bodyTemperature', 'filledLeak', 'warnSign', 'fillLabel', 'seal','fill_media'].includes(item.field)">
+          v-else-if="['userId', 'type', 'status', 'storeId', 'personCode', 'optType', 'corrosion', 'crackle', 'deform', 'damage', 'safeAnnex', 'gasPressure', 'bodyDeform', 'fillingLeak', 'bodyTemperature', 'filledLeak', 'warnSign', 'fillLabel', 'seal','addressType'].includes(item.field)">
           <template slot-scope="scope">
             <div :style="{color: filterColor(scope.row,item.options,item.field)}">
               {{initDictvalueil(scope.row,item.options,item.field)}}

+ 44 - 41
src/components/waybillForm.vue

@@ -1,12 +1,14 @@
 <template>
   <div class="waybil_form">
     <h4 class="head_title">{{title}}</h4>
-   <!-- <div class="select_type">
-      <div style="margin-right: 20px;">
-        <el-radio v-model="radio" label="1">保存到地址簿</el-radio>
+    <div class="card_deliverer" v-if="deliverer" @click="addressBook"><i
+        class="el-icon-collection icon_address"></i>配送人员薄</div>
+    <div class="select_type" v-else>
+      <div style="margin-right: 20px;" v-if="conserveFlag">
+        <el-radio v-model="radio" label="1" @click.native.prevent="clickitem('1')">保存到地址簿</el-radio>
       </div>
-      <div class="card_book" @click="addressBook"><i class="el-icon-collection icon_address"></i>地址簿</div>
-    </div> -->
+      <div class="card_book" @click="addressBook"><i class="el-icon-collection icon_address"></i>{{thinTitle}}</div>
+    </div>
     <el-form style="width: 100%;" :model="ruleForm" :rules="rules" :label-position="labelPosition" label-width="80px"
       ref="ruleForm">
       <el-form-item label="姓名" prop="name">
@@ -15,16 +17,9 @@
       <el-form-item label="电话" prop="phone">
         <el-input v-model="ruleForm.phone" placeholder="请输入电话"></el-input>
       </el-form-item>
-      <el-form-item label="地址" prop="address">
+      <el-form-item label="地址" prop="address" v-if="!deliverer">
         <el-input v-model="ruleForm.address" placeholder="请输入地址"></el-input>
       </el-form-item>
-      <!-- <el-form-item label="省市区" prop="region">
-        <el-cascader size="large" :options="options" v-model="selectedOptions" @change="handleChange">
-        </el-cascader>
-      </el-form-item>
-      <el-form-item label="详细地址" prop="address">
-        <el-input v-model="ruleForm.address" placeholder="请输入详细地址"></el-input>
-      </el-form-item> -->
     </el-form>
   </div>
 </template>
@@ -37,6 +32,11 @@
   export default {
     name: 'waybillForm',
     props: {
+      // 地址簿名称
+      thinTitle: {
+        type: String,
+        default: () => '地址簿',
+      },
       // 表单tabel数据
       title: {
         type: String,
@@ -47,13 +47,23 @@
         type: Object,
         default: () => {},
       },
+      // 配送人
+      deliverer: {
+        type: Boolean,
+        default: () => false,
+      },
+      // 配送人
+      conserveFlag: {
+        type: Boolean,
+        default: () => true,
+      },
     },
     data() {
       return {
         labelPosition: 'left',
         options: regionData,
         selectedOptions: [],
-        radio: '',
+        radio: '1',
         rules: {
           name: {
             required: true,
@@ -87,36 +97,12 @@
       }
     },
     methods: {
-      handleChange(value) {
-        this.getCodeToText(value)
-      },
       addressBook() {
         this.$emit('addressBook')
       },
-      getCodeToText(codeArray) {
-        this.selectedOptions = codeArray
-        this.ruleForm.regionCode = codeArray
-        // console.log(codeArray, 8887)
-        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;
-        }
-        this.ruleForm.region = area
+      clickitem(value) {
+        value === this.radio ? this.radio = '' : this.radio = value
+        this.$emit('conserveSelect', this.radio)
       },
       //子组件校验,传递到父组件
       validateForm() {
@@ -174,4 +160,21 @@
     align-items: center;
     cursor: pointer;
   }
+
+  .card_deliverer {
+    cursor: pointer;
+    margin-left: 80px;
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    margin-bottom: 20px;
+  }
+
+  .card_deliverer:hover {
+    color: #409EFF;
+  }
+
+  .card_book:hover {
+    color: #409EFF;
+  }
 </style>

+ 44 - 6
src/components/waybillInformation.vue

@@ -5,12 +5,27 @@
     <div class="order_title">防拆标签码: <span>{{list.tamperProofLabel}}</span></div>
     <div class="order_title">状态 <span :style="{color: filterColor(list)}">{{initDictvalueil(list)}}</span>
     </div>
-    <div class="order_title">寄: <span>{{list.senderAddressName}} {{list.senderAddressPhone}}
-        {{list.senderAddressDetails}}</span></div>
-    <div class="order_title">收: <span>{{list.consigneeAddressName}} {{list.consigneeAddressPhone}}
-        {{list.consigneeAddressDetails}}</span></div>
-    <div class="order_headline">请确定防拆标签完整</div>
-    <div class="same_row_in">
+    <div class="order_title flex_dismantle">
+      <div style="display: flex;">寄件人:
+        <span class="order_name">{{list.senderAddressName}}</span>
+        <span class="order_phone phone_color"
+          @click="DialProblem(list.senderAddressPhone)">{{list.senderAddressPhone}}</span>
+      </div>
+      <span>{{list.senderAddressDetails}}</span>
+    </div>
+    <div class="order_title">配送人:
+      <span class="order_name">{{list.deliveryName}}</span>
+      <span class="order_phone phone_color" @click="DialProblem(list.deliveryPhone)">{{list.deliveryPhone}}</span>
+    </div>
+    <div class="order_title">
+      <div style="display: flex;align-items: center;">收件人:
+        <span class="order_name">{{list.consigneeAddressName}}</span>
+        <span class="order_phone">{{list.consigneeAddressPhone}}</span>
+      </div>
+      <span>{{list.consigneeAddressDetails}}</span>
+    </div>
+    <div class="order_headline" v-if="list.tamperProofLabelImg">请确定防拆标签完整</div>
+    <div class="same_row_in" v-if="list.tamperProofLabelImg">
       <div v-for="(item,index) in getimagetamper(list)" :key="index">
         <el-image class="img_antidismantle" :src="item" fit="fill"></el-image>
       </div>
@@ -203,6 +218,12 @@
           let arr = value.tamperProofLabelImg.split(',')
           return arr
         }
+      },
+      // 拨打电话
+      DialProblem(phone) {
+        const url = `tel:${phone}`;
+        window.location.href = url;
+        console.log(phone, 24)
       }
     }
   }
@@ -220,6 +241,11 @@
     color: #303133;
   }
 
+  .flex_dismantle {
+    display: flex;
+    flex-direction: column;
+  }
+
   .order_title {
     font-size: 15px;
     margin-bottom: 8px;
@@ -230,6 +256,18 @@
     }
   }
 
+  .order_name {
+    margin-left: 5px;
+  }
+
+  .order_phone {
+    margin-left: 5px;
+  }
+
+  .phone_color {
+    color: #ffa900 !important;
+  }
+
   .order_headline {
     font-size: 17px;
     color: #F56C6C;

+ 9 - 9
src/router/generator-routers.js

@@ -74,15 +74,15 @@ const rootRouter = {
       },
       component: () => import('@/views/system/UserManagement'),
     },
-    // {
-    //   path: '/ClientManagement',
-    //   name: 'ClientManagement',
-    //   meta: {
-    //     icon: 'icon-yonghuguanli',
-    //     title: '客户管理'
-    //   },
-    //   component: () => import('@/views/system/ClientManagement'),
-    // },
+    {
+      path: '/addressBook',
+      name: 'addressBook',
+      meta: {
+        icon: 'icon-cangku',
+        title: '地址薄管理'
+      },
+      component: () => import('@/views/system/addressBook'),
+    },
     // {
     //   path: '/StoreManagement',
     //   name: 'StoreManagement',

+ 0 - 1
src/utils/request.js

@@ -23,7 +23,6 @@ const request = axios.create({
 
 // 异常拦截处理器
 const errorHandler = (error) => {
-  // console.log(error,665)
   if (error.message == 'timeout of 10000ms exceeded') {
     return Message.error('当前网络不稳定,请更换网络重试')
   } else {

+ 3 - 3
src/views/newInquiry.vue

@@ -56,7 +56,7 @@
 
 <script>
   import {
-    getReceipt
+    getCustomerReceipt
   } from '@/api/waybill'
   import {
     getWaybill,
@@ -250,7 +250,7 @@
           spinner: 'el-icon-loading',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-        getReceipt(params).then(res => {
+        getCustomerReceipt(params).then(res => {
           if (res.code == 200) {
             this.$refs.information.isModalVisibleil = false
             this.getInformation()
@@ -283,7 +283,7 @@
           spinner: 'el-icon-loading',
           background: 'rgba(0, 0, 0, 0.7)'
         });
-        getReceipt(params).then(res => {
+        getCustomerReceipt(params).then(res => {
           if (res.code == 200) {
             this.$refs.information.isModalVisible = false
             this.getInformation()

+ 12 - 13
src/views/page/Home.vue

@@ -3,19 +3,19 @@
     <div class="card_head_home">
       <div class="card_image_flex">
         <div style="display: flex;flex: none;height: 120px;">
-          <el-image :src="require('@/assets/images/transport.svg')"></el-image>
+          <el-image style="width: 286px;height: 120px;" :src="require('@/assets/images/transport.svg')"></el-image>
           <div class="home_content">
             <div class="title_content1">Logistics transportation system</div>
             <div class="title_content">物流运输 高效管理</div>
             <div class="title_content1">物流运输管理系统 冷链送药追溯平台</div>
           </div>
-          <el-image :src="require('@/assets/images/transport1.svg')"></el-image>
+          <el-image style="width: 166px;height: 120px;" :src="require('@/assets/images/transport1.svg')"></el-image>
         </div>
       </div>
-      <div class="operationManual" @click="goTickets">
-        <el-image style="width: 30px;height: 30px;" :src="require('@/assets/images/manual.png')"></el-image>
-        <span>冷链送药追溯平台使用手册</span>
-      </div>
+    </div>
+    <div class="operationManual" @click="goTickets">
+      <el-image style="width: 25px;height: 25px;" :src="require('@/assets/images/manual.png')"></el-image>
+      <span>冷链送药追溯平台使用手册</span>
     </div>
     <div class="card_head_statistics">
       <div class="item_statistics">
@@ -272,16 +272,15 @@
   }
 
   .operationManual {
-    position: absolute;
-    right: 10px;
-    bottom: 10px;
     display: flex;
     align-items: center;
     cursor: pointer;
+    justify-content: flex-end;
+    margin-top: 10px;
 
     span {
       color: #909399;
-      font-size: 18px;
+      font-size: 16px;
       margin-left: 5px;
     }
   }
@@ -303,20 +302,20 @@
 
   .title_content {
     color: #2d4578;
-    font-size: 30px;
+    font-size: 24px;
     font-weight: 600;
     margin: 10px 0px;
   }
 
   .title_content1 {
     color: #2d4578;
-    font-size: 20px;
+    font-size: 17px;
   }
 
   .card_head_statistics {
     display: flex;
     align-items: center;
-    margin-top: 20px;
+    margin-top: 10px;
     background-color: #fff;
     border-radius: 10px;
     padding: 15px;

+ 190 - 51
src/views/system/WaybillManagement.vue

@@ -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()
       }
     }

+ 95 - 0
src/views/system/address.js

@@ -0,0 +1,95 @@
+import {
+  userType
+} from '@/assets/js/blockSort'
+export const employee = () => {
+  return [{
+    field: 'name',
+    label: '姓名',
+    align: 'center',
+  }, {
+    field: 'phone',
+    label: '电话号码',
+    align: 'center',
+  }, {
+    field: 'address',
+    label: '详细地址',
+    align: 'center',
+  }, {
+    field: 'addressType',
+    label: '类型',
+    align: 'center',
+    options: userType()
+  }, {
+    field: 'action',
+    label: '操作',
+    colWidth: '260px',
+    align: 'center',
+    labelButton: [{
+      type: 'logs',
+      label: '详情',
+      icon: 'el-icon-tickets',
+      style: 'success',
+    }, {
+      type: 'edit',
+      label: '编辑',
+      icon: 'el-icon-edit',
+      style: 'primary',
+    }, {
+      type: 'del',
+      label: '删除',
+      icon: 'el-icon-delete',
+      style: 'danger',
+    }]
+  }]
+}
+
+export const formRules = () => {
+  return [{
+      field: 'name',
+      label: '姓名',
+      placeholder: '请输入姓名',
+      type: 'input',
+      colWidth: 24,
+      rules: [{
+        required: true,
+        message: '请输入姓名',
+        trigger: 'blur'
+      }]
+    }, {
+      field: 'phone',
+      label: '电话号码',
+      placeholder: '请输入电话号码',
+      type: 'input',
+      colWidth: 24,
+      rules: [{
+        required: true,
+        message: '请输入电话号码',
+        trigger: 'blur'
+      }]
+    }, {
+      field: 'address',
+      label: '详细地址',
+      placeholder: '请输入详细地址',
+      type: 'input',
+      colWidth: 24,
+      rules: [{
+        required: true,
+        message: '请输入详细地址',
+        trigger: 'blur'
+      }]
+    },
+    {
+      field: 'addressType',
+      label: '类型',
+      placeholder: '类型',
+      type: 'radio',
+      colWidth: 24,
+      rules: [{
+        required: true,
+        message: '选择类型',
+        trigger: 'change'
+      }],
+      options: userType()
+    },
+  ]
+}

+ 232 - 0
src/views/system/addressBook.vue

@@ -0,0 +1,232 @@
+<template>
+  <!-- 地址簿管理 -->
+  <div class="home">
+    <actionBar :operateList="operateList" :formList="formList" :ruleForm="searchRuleForm" @openModel="openModel"
+      @searchProtocol="searchProtocol"></actionBar>
+    <div class="card_content">
+      <!-- 表单 -->
+      <tables :suspension="true" :tableList="tableList" :tableData="tableData" @buttonData="buttonData"></tables>
+      <!-- 分页 -->
+      <div v-if="Total">
+        <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
+          @changeCurrent="changeCurrent">
+        </pagination>
+      </div>
+    </div>
+    <el-dialog :title="staffTitle" :visible.sync="staffDialogVisible" width="600px" :close-on-click-modal="false"
+      @close="closeDialog">
+      <forms ref="childRules" :formNewList="formRuleList" :ruleForm="ruleForm" labelWidth="100px">
+      </forms>
+      <span slot="footer" class="dialog-footer" v-if="operationType != 'logs'">
+        <el-button plain @click="staffDialogVisible = false">取 消</el-button>
+        <el-button type="primary" :loading="confirmLoading" @click="handleAdd">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import {
+    getAddress,
+    addAddress,
+    putAddress,
+    delAddress
+  } from '@/api/address'
+  import actionBar from '@/components/actionBar'
+  import tables from '@/components/tables'
+  import pagination from '@/components/pagination'
+  import forms from '@/components/forms'
+  import {
+    formRules,
+    employee,
+  } from "./address.js";
+  export default {
+    name: 'addressBook',
+    components: {
+      actionBar,
+      tables,
+      pagination,
+      forms
+    },
+    data() {
+      return {
+        operateList: [{
+          type: 'add',
+          title: '添加',
+          icon: 'el-icon-plus',
+        }],
+        formList: [{
+          type: 'input',
+          label: '关键字',
+          field: 'name',
+          placeholder: '请输入关键字快速查找',
+        }],
+        searchRuleForm: {
+          name: '',
+        },
+        Pagination: {
+          PageIndex: 1,
+          PageSize: 10,
+        },
+        Total: 0,
+        tableData: [],
+        operationType: '',
+        tableList: employee(),
+        staffTitle: '添加',
+        staffDialogVisible: false,
+        formRuleList: [],
+        ruleForm: {
+          name: '',
+          phone: '',
+          address: '',
+          addressType: '',
+        },
+        confirmLoading: false,
+        selectingData: {},
+      }
+    },
+    mounted() {
+      this.getList()
+    },
+    methods: {
+      // 搜索
+      searchProtocol(value) {
+        this.Pagination.PageIndex = 1
+        this.searchValue = value
+        this.getList()
+      },
+      // 获取列表
+      getList() {
+        var params = {
+          page: this.Pagination.PageIndex,
+          pageSize: this.Pagination.PageSize,
+          ...this.searchValue
+        }
+        getAddress(params).then(res => {
+          if (res.code == 200) {
+            this.tableData = res.data.list
+            this.Total = res.data.count
+          }
+        })
+      },
+      // 弹窗表单添加
+      handleAdd() {
+        let flag = this.$refs['childRules'].validateForm();
+        if (flag) {
+          if (this.operationType == 'add') {
+            this.confirmLoading = true
+            var params = {
+              ...this.ruleForm
+            }
+            addAddress(params).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success'
+                });
+                this.getList()
+              }
+              this.staffDialogVisible = false
+              this.confirmLoading = false
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+          } else if (this.operationType == 'edit') {
+            this.confirmLoading = true
+            var params = {
+              id: this.selectingData.id,
+              name: this.ruleForm.name,
+              phone: this.ruleForm.phone,
+              address: this.ruleForm.address,
+              addressType: this.ruleForm.addressType,
+            }
+            putAddress(params).then(res => {
+              if (res.code == 200) {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success'
+                });
+                this.getList()
+              }
+              this.staffDialogVisible = false
+              this.confirmLoading = false
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+          }
+        } else {
+          this.$message.error('表单信息不完整,请继续填写完整');
+        }
+      },
+      buttonData(row, type) {
+        const dataList = formRules();
+        this.formRuleList = dataList;
+        this.selectingData = row
+        this.operationType = type
+        if (type == 'edit') {
+          this.staffTitle = '编辑'
+          this.staffDialogVisible = true
+          setTimeout(() => {
+            this.$nextTick(() => {
+              this.ruleForm.name = row.name
+              this.ruleForm.phone = row.phone
+              this.ruleForm.address = row.address
+              this.ruleForm.addressType = row.addressType
+            })
+          })
+        } else if (type == 'logs') {
+          this.staffTitle = '详情'
+          this.staffDialogVisible = true
+          this.formRuleList.forEach((item, index) => {
+            item.disabled = true
+          })
+          this.ruleForm = JSON.parse(JSON.stringify(row))
+        } else if (type == 'del') {
+          this.deleteUser(row.id)
+        }
+      },
+      openModel(type) {
+        const dataList = formRules();
+        this.formRuleList = dataList;
+        this.staffTitle = '添加'
+        this.staffDialogVisible = true
+        this.operationType = type
+      },
+      // 删除用户
+      deleteUser(id) {
+        this.$confirm('此操作将永久删除用户, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          delAddress({
+            id: id,
+          }).then(res => {
+            if (res.code == 200) {
+              this.$message({
+                message: '操作成功',
+                type: 'success'
+              });
+              this.getList()
+            }
+          })
+        }).catch(() => {});
+      },
+      changeSize(val) {
+        this.Pagination.PageSize = val
+        this.getList()
+      },
+      changeCurrent(val) {
+        this.Pagination.PageIndex = val
+        this.getList()
+      },
+      // 清空表单
+      closeDialog() {
+        this.$refs.childRules.resetCheck();
+      }
+    }
+  }
+</script>
+
+<style lang="scss">
+</style>

+ 26 - 26
src/views/system/userTable.js

@@ -125,19 +125,19 @@ export const formRules = () => {
         trigger: 'blur'
       }]
     },
-    // {
-    //   field: 'type',
-    //   label: '客户类型',
-    //   placeholder: '客户类型',
-    //   type: 'radio',
-    //   colWidth: 24,
-    //   rules: [{
-    //     required: true,
-    //     message: '选择客户类型',
-    //     trigger: 'change'
-    //   }],
-    //   options: orderStatus()
-    // },
+    {
+      field: 'type',
+      label: '客户类型',
+      placeholder: '客户类型',
+      type: 'radio',
+      colWidth: 24,
+      rules: [{
+        required: true,
+        message: '选择客户类型',
+        trigger: 'change'
+      }],
+      options: orderStatus()
+    },
   ]
 }
 
@@ -165,18 +165,18 @@ export const formRulesil = () => {
         trigger: 'blur'
       }]
     },
-    // {
-    //   field: 'type',
-    //   label: '客户类型',
-    //   placeholder: '客户类型',
-    //   type: 'radio',
-    //   colWidth: 24,
-    //   rules: [{
-    //     required: true,
-    //     message: '选择客户类型',
-    //     trigger: 'change'
-    //   }],
-    //   options: orderStatus()
-    // },
+    {
+      field: 'type',
+      label: '客户类型',
+      placeholder: '客户类型',
+      type: 'radio',
+      colWidth: 24,
+      rules: [{
+        required: true,
+        message: '选择客户类型',
+        trigger: 'change'
+      }],
+      options: orderStatus()
+    },
   ]
 }

+ 22 - 6
src/views/system/waybill.js

@@ -18,6 +18,16 @@ export const employee = () => {
     align: 'center',
     options: WaybillStatus()
   }, {
+    field: 'deliveryName',
+    label: '配送员姓名',
+    align: 'center',
+    colWidth: '140px',
+  }, {
+    field: 'deliveryPhone',
+    label: '配送员电话',
+    align: 'center',
+    colWidth: '140px',
+  }, {
     field: 'senderAddressDetails',
     label: '寄件地址',
     align: 'center',
@@ -33,7 +43,7 @@ export const employee = () => {
     align: 'center',
     colWidth: '220px',
   }, {
-    field: 'createdAt',
+    field: 'orderTime',
     label: '下单时间',
     align: 'center',
     colWidth: '180px',
@@ -118,16 +128,22 @@ export const addressBook = () => {
     label: '电话',
     align: 'center',
   }, {
-    field: 'region',
-    label: '省市区',
-    align: 'center',
-  }, {
     field: 'address',
     label: '详细地址',
     align: 'center',
   }, ]
 }
-
+export const addressDeliverer = () => {
+  return [{
+    field: 'nickName',
+    label: '姓名',
+    align: 'center',
+  }, {
+    field: 'phone',
+    label: '电话',
+    align: 'center',
+  }]
+}
 export const sendList = () => {
   return [{
     field: 'coolerBoxId',