Sfoglia il codice sorgente

feat:提货预约更改流程

zh 2 anni fa
parent
commit
2785ca72da

+ 10 - 0
src/api/basic_data/dealer.js

@@ -188,3 +188,13 @@ export function importCustomer(data, name) {
     name
   })
 }
+
+
+//基础上设置自提和物流
+export function updatePick(params) {
+  return request({
+    url: '/customer/updatePick',
+    method: 'post',
+    params
+  })
+}

+ 1 - 1
src/api/supply/pickup.js

@@ -186,7 +186,6 @@ export function cancelData(params) {
     params
   })
 }
-
 // 订单查询物流
 export function getListOrderTrack(params) {
   return request({
@@ -195,3 +194,4 @@ export function getListOrderTrack(params) {
     params
   })
 }
+

+ 84 - 19
src/views/basic_data/dealer/components/dealer_list-detail.vue

@@ -260,41 +260,70 @@
       <div class="diy-table-1" style="width: 100%">
         <el-form label-width="120px" class="demo-ruleForm">
           <el-row>
-            <el-col :span="12">
+            <el-col :span="6">
               <el-form-item label="集团客户" prop="">
                 <el-radio v-model="infoList.isGroupCompany" :label="true">是</el-radio>
                 <el-radio v-model="infoList.isGroupCompany" :label="false">否</el-radio>
               </el-form-item>
             </el-col>
+            <el-col :span="6">
+              <el-form-item label="是否可转折让" prop="">
+                <el-radio v-model="infoList.isZr" :label="true">是</el-radio>
+                <el-radio v-model="infoList.isZr" :label="false">否</el-radio>
+              </el-form-item>
+            </el-col>
             <el-col :span="12">
+              <el-form-item label-width="0px"> 注:设置后返利可以转入折让钱包 </el-form-item>
+            </el-col>
+            <!-- <el-col :span="12">
               <el-form-item label="是否前置仓" prop="">
                 <el-radio v-model="infoList.isFront" :label="true">前置仓</el-radio>
                 <el-radio v-model="infoList.isFront" :label="false">经销商自有仓库</el-radio>
                 <el-button type="primary" size="mini" @click="handelSubmit">修改</el-button>
               </el-form-item>
-
-            </el-col>
+            </el-col> -->
           </el-row>
-          <el-form-item label="分子公司" prop="">
-            <el-tag class="tagStyle" v-for="v in infoList.kingDeeCustomers" :key="v.id">{{ v.name }}</el-tag>
-          </el-form-item>
-          <el-form-item label="是否可转折让" prop="">
-            <el-radio v-model="infoList.isZr" :label="true">是</el-radio>
-            <el-radio v-model="infoList.isZr" :label="false">否</el-radio>
-          </el-form-item>
+          <el-col>
+            <el-form-item label="分子公司">
+              <el-tag class="tagStyle" v-for="v in infoList.kingDeeCustomers" :key="v.id">{{ v.name }}</el-tag>
+            </el-form-item>
+          </el-col>
+          <el-col>
+            <el-form-item label="提货方式">
+              <div>
+                <el-checkbox-group v-model="radio">
+                  <el-checkbox :label="1"> 物流配送(嘉贤物流)</el-checkbox>
+                  <el-checkbox :label="2">商家自提</el-checkbox>
+                </el-checkbox-group>
+              </div>
+              <div>选择商家自提需配置物流产品类别</div>
+              <div>
+
+                <el-checkbox-group v-model="pickCategory">
+                  <el-checkbox v-for="(item, index) in dataList" :key="index" :label="item.id">
+                    {{ item.name }}
+                  </el-checkbox>
+                </el-checkbox-group>
+              </div>
+              <div>注:设置配送方式后提货预约可根据配置的提货方式进行选择</div>
+              <div>
+                <el-button type="primary" size="default" @click="onSubmit">保存</el-button>
+              </div>
+            </el-form-item>
+          </el-col>
         </el-form>
       </div>
     </el-card>
-
   </div>
 </template>
 
 <script>
-import { getDealerInfo, updateCustomer } from '@/api/basic_data/dealer'
+import { getProductCategoryKingDeeCategoryList } from '@/api/basic_data/material'
+import { getDealerInfo, updateCustomer, updatePick } from '@/api/basic_data/dealer'
+import ret from 'bluebird/js/release/util'
 
 export default {
   props: {
-
     detailsId: {
       type: String,
       required: true
@@ -302,24 +331,60 @@ export default {
   },
   data() {
     return {
-      infoList: {}
+      infoList: {},
+      dataList: [],
+      radio: [],
+      pickCategory: []
     }
   },
 
   async created() {
+    this.getDataList()
     const res = await getDealerInfo({ id: this.detailsId })
+    if (res.data.isFront) {
+      this.radio.push(1)
+    }
+    if (res.data.isPick) {
+      this.radio.push(2)
+    }
+    if (res.data.kingDeeCustomerCategories) {
+      this.pickCategory  = res.data.kingDeeCustomerCategories.map(k=>{
+        return k.categoryId
+      })
+     
+    }
     this.infoList = res.data
   },
   methods: {
     goBack() {
       this.$parent.isShow = true
     },
-    handelSubmit(){
+    //金蝶存货类别列表
+    async getDataList() {
+      const res = await getProductCategoryKingDeeCategoryList()
+      this.dataList = res.data
+    },
+
+    handelSubmit() {
       updateCustomer({
-        id:this.infoList.id,
-        isFront:this.infoList.isFront
-      }).then(res=>{
-        this.$successMsg(this.infoList.isFront?'已更改为前置仓':'已更改为经销商自有仓库')
+        id: this.infoList.id,
+        isFront: this.infoList.isFront
+      }).then(res => {
+        this.$successMsg(this.infoList.isFront ? '已更改为前置仓' : '已更改为经销商自有仓库')
+      })
+    },
+    onSubmit() {
+      if (this.radio.includes(2) && !this.pickCategory.length) {
+        this.$errorMsg('商家自提必须选择产品类别')
+        return
+      }
+      updatePick({
+        id: this.detailsId,
+        isFront: this.radio.includes(1),
+        isPick: this.radio.includes(2),
+        pickCategory: this.pickCategory.join(',')
+      }).then(res => {
+        this.$successMsg('保存成功')
       })
     }
   }

+ 2 - 0
src/views/dashboard/index.vue

@@ -175,6 +175,7 @@
           <el-table-column align="center" label="" min-width="160" show-overflow-tooltip fixed="right">
             <template slot-scope="scope">
               <el-button type="text" class="textColor" @click="handLogistics(scope.row)">查看</el-button>
+
             </template>
           </el-table-column>
         </el-table>
@@ -322,6 +323,7 @@ export default {
       visible: false,
       orderId: '',
       logisticsDetail: []
+
     }
   },
 

+ 2 - 2
src/views/supply/engin/components/engin_form.vue

@@ -299,7 +299,7 @@
         </el-table-column>
         <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-input v-model="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
+            <el-input v-model.number="scope.row.qty" size="small" type="number" @mousewheel.native.prevent />
           </template>
         </el-table-column>
         <el-table-column align="center" label="订单金额" prop="myTotalAmount" min-width="100" show-overflow-tooltip>
@@ -906,7 +906,7 @@ export default {
               return
             }
             console.log(this.goodsList[i].qty );
-            if (this.goodsList[i].qty == null || this.goodsList[i].qty == '' || Number(this.goodsList[i].qty) < 0) {
+            if (this.goodsList[i].qty == null || this.goodsList[i].qty === '' || Number(this.goodsList[i].qty) < 0) {
               this.$errorMsg('数量不能为空或者小于0')
               return
             }

+ 14 - 1
src/views/supply/pickup/check.vue

@@ -197,6 +197,16 @@
                 {{ scope.row.printNum ? '已打单(' + scope.row.printNum + ')' : '未打单' }}
               </template>
             </el-table-column>
+            <el-table-column align="left" label="是否上楼" prop="isUp" min-width="160" show-overflow-tooltip >
+              <template v-slot="row">
+                {{ row.isUp=='YES'?'是':'否' }}
+              </template>
+            </el-table-column>
+          <el-table-column align="left" label="是否卸货" prop="isDischarge" min-width="160" show-overflow-tooltip >
+            <template v-slot="row">
+                {{ row.isDischarge=='YES'?'是':'否' }}
+              </template>
+          </el-table-column>
             <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
                 <CopyButton :copyText="scope.row.informationKey" />
@@ -578,8 +588,11 @@ export default {
       })
     },
     getLogisticsId(e) {
-      const item = this.companyList.find(k => k.id === e)
+      if (this.companyList.length) {
+        const item = this.companyList.find(k => k.id === e)
       this.screenForm.company = item.logisticsCompany
+      }
+  
     },
     // 获取仓库列表
     getWarehouseList() {

+ 140 - 75
src/views/supply/pickup/components/pickup_form.vue

@@ -15,7 +15,12 @@
         <el-row :gutter="20">
           <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="选择仓库" prop="warehouse">
-              <el-select v-model="mainForm.warehouse" placeholder="请选择仓库" style="width: 100%" :disabled="!!listItem">
+              <el-select
+                v-model="mainForm.warehouse"
+                placeholder="请选择仓库"
+                style="width: 100%"
+                :disabled="!!listItem"
+              >
                 <el-option
                   :label="item.name"
                   :value="item.id"
@@ -57,12 +62,11 @@
           <el-col :xs="24" :sm="12" :lg="8">
             <el-form-item label="提货方式" prop="pickupWay">
               <el-radio-group v-model="mainForm.pickupWay" :disabled="flag">
-                <!-- ||(isFront===false && item.dictCode=='2' )  -->
                 <el-radio
                   :label="item.dictCode"
-                  :disabled="isFront === true && item.dictCode == '1'"
                   v-for="(item, index) in pickupWayList"
                   :key="index"
+                  :disabled="item.disabled"
                   >{{ item.dictValue }}
                 </el-radio>
               </el-radio-group>
@@ -92,26 +96,51 @@
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :xs="24" :sm="12" :lg="8" v-if="mainForm.pickupWay == '2'">
-            <el-form-item label="物流公司" prop="company">
-              <el-select
-                v-model="mainForm.logisticsId"
-                @change="getLogisticsId"
-                placeholder="全部"
-                style="width: 100%"
-                :disabled="flag"
-              >
-                <el-option
-                  :label="item.logisticsCompany"
-                  :value="item.id"
-                  :disabled="comDisabled(item.id)"
-                  v-for="(item, index) in companyList"
-                  :key="index"
-                ></el-option>
-              </el-select>
+          <template v-if="mainForm.pickupWay == '2'">
+            <el-col :xs="24" :sm="12" :lg="8">
+              <el-form-item label="物流公司" prop="company">
+                <el-select
+                  v-model="mainForm.logisticsId"
+                  @change="getLogisticsId"
+                  placeholder="全部"
+                  style="width: 100%"
+                  :disabled="flag"
+                >
+                  <el-option
+                    :label="item.logisticsCompany"
+                    :value="item.id"
+                    v-for="(item, index) in companyList"
+                    :key="index"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col class="pd-lr" :span="16">
+              <el-col :xs="24" :sm="12" :lg="12">
+                <el-form-item label="是否上楼" prop="isUp">
+                  <el-radio-group v-model="mainForm.isUp" :disabled="flag">
+                    <el-radio label="YES"> 是 </el-radio>
+                    <el-radio label="NO"> 否 </el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+              <el-col :xs="24" :sm="12" :lg="12">
+                <el-form-item label="是否卸货" prop="isDischarge">
+                  <el-radio-group v-model="mainForm.isDischarge" :disabled="flag">
+                    <el-radio label="YES"> 是 </el-radio>
+                    <el-radio label="NO"> 否 </el-radio>
+                  </el-radio-group>
+                </el-form-item>
+              </el-col>
+            </el-col>
+          </template>
+          <el-col :xs="24" :sm="12" :lg="8">
+            <el-form-item label="备注" prop="remark">
+              <el-input  v-model="mainForm.remark" placeholder="请输入备注" :disabled="flag"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
+
         <!--        <el-row :gutter="20">-->
         <!--          <template v-if="logisticsNumber === '001'">-->
         <!--            <el-col :xs="24" :sm="8" :lg="8">-->
@@ -332,7 +361,7 @@
             min-width="100"
             show-overflow-tooltip
           ></el-table-column>
-          <el-table-column fixed="right" label="操作" width="100" v-if="flag && mainForm.pickupWay=='2'">
+          <el-table-column fixed="right" label="操作" width="100" v-if="flag && mainForm.pickupWay == '2'">
             <template slot-scope="scope">
               <el-button @click="handLogistics(scope.row)" type="text" size="small">物流信息</el-button>
             </template>
@@ -340,7 +369,6 @@
         </el-table>
       </div>
     </div>
-
     <div class="page-footer">
       <div class="footer" :class="classObj">
         <el-button type="primary" @click="clickSubmitForm" v-if="!flag" :loading="formLoading"
@@ -412,7 +440,9 @@ export default {
         logisticsId: '',
         receivingName: '',
         phone: '',
-        address: ''
+        address: '',
+        isUp: 'NO',
+        isDischarge: 'NO'
       },
       mainFormRules: {
         date: [{ required: true, message: '请选择预约日期', trigger: 'change' }],
@@ -432,12 +462,11 @@ export default {
       pickupCarList: [],
       companyList: [],
       logisticsNumber: '',
-      isFront: null,
       storeList: [
-        {
-          label: '前置仓',
-          value: 0
-        },
+        // {
+        //   label: '前置仓',
+        //   value: 0
+        // },
         {
           label: '工程机',
           value: 1
@@ -454,7 +483,11 @@ export default {
       },
       visible: false,
       orderId: '',
-      logisticsDetail: []
+      logisticsDetail: [],
+      frontPickType: null,
+      isFront: null,
+      isPick: null,
+      isPickUpGoods: false
     }
   },
 
@@ -467,23 +500,21 @@ export default {
         hideSidebar: !this.sidebar.opened,
         openSidebar: this.sidebar.opened
       }
-    },
-    comDisabled() {
-      return id => {
-        if (this.isFront === false && id === '1574563841707114498') {
-          return true
-        }
-        if (this.isFront === true && id !== '1574563841707114498') {
-          return true
-        }
-        return false
-      }
     }
+    // comDisabled() {
+    //   return id => {
+    //     if (this.isFront === false && id === '1574563841707114498') {
+    //       return true
+    //     }
+    //     if (this.isFront === true && id !== '1574563841707114498') {
+    //       return true
+    //     }
+    //     return false
+    //   }
+    // }
   },
 
   created() {
-    this.isFront = JSON.parse(localStorage.getItem('supply_user')).isFront
-
     this.getWarehouseList()
     this.getPickupWayList()
     this.getPickupManList()
@@ -578,6 +609,8 @@ export default {
         this.mainForm.company = data.pickLogistics
         this.mainForm.remark = data.remark
         this.mainForm.logisticsId = data.logisticsId
+        this.mainForm.isUp = data.isUp
+        this.mainForm.isDischarge = data.isDischarge
         if (this.mainForm.pickupWay == 2) {
           const item = this.companyList.find(k => k.id === data.logisticsId)
           this.logisticsNumber = item.logisticsNumber
@@ -622,31 +655,46 @@ export default {
     // 获取提货方式列表
     getPickupWayList() {
       getDictList({ sysDictEnum: 'PICK' }).then(res => {
-        this.pickupWayList = res.data
-        if (this.isFront === true) {
-          this.mainForm.pickupWay = '2'
-          this.mainForm.logisticsId = '1574563841707114498'
-          getCompanyList({
-            pageNum: 1,
-            pageSize: -1
-          }).then(res => {
-            this.companyList = res.data.records
-            const item = this.companyList.find(k => k.id === this.mainForm.logisticsId)
-            this.mainForm.company = item.logisticsCompany
-            this.logisticsNumber = item.logisticsNumber
-            if (this.logisticsNumber === '001' && this.deliverList && this.deliverList.length) {
-              if (!this.listItem) {
-                this.deliverList.forEach(k => {
-                  this.$set(k, 'receivingName', '')
-                  this.$set(k, 'phone', '')
-                  this.$set(k, 'address', '')
-                })
-              }
+        const localData = JSON.parse(localStorage.getItem('supply_user'))
+        this.frontPickType = localData.frontPickType
+        this.isFront = localData.isFront
+        this.isPick = localData.isPick
+          res.data.forEach(k => {
+          if (this.frontPickType) {
+            if (!this.isFront && k.dictCode == 1) {
+              k.disabled = true
             }
-          })
-        } else if (this.isFront === false) {
-          this.mainForm.pickupWay = '1'
-        }
+            if (!this.isPick && k.dictCode == 2) {
+              k.disabled = true
+            }
+          }
+        })
+        this.pickupWayList = res.data
+
+        // if (this.isFront === true) {
+        //   this.mainForm.pickupWay = '2'
+        //   this.mainForm.logisticsId = '1574563841707114498'
+        //   getCompanyList({
+        //     pageNum: 1,
+        //     pageSize: -1
+        //   }).then(res => {
+        //     this.companyList = res.data.records
+        //     const item = this.companyList.find(k => k.id === this.mainForm.logisticsId)
+        //     this.mainForm.company = item.logisticsCompany
+        //     this.logisticsNumber = item.logisticsNumber
+        //     if (this.logisticsNumber === '001' && this.deliverList && this.deliverList.length) {
+        //       if (!this.listItem) {
+        //         this.deliverList.forEach(k => {
+        //           this.$set(k, 'receivingName', '')
+        //           this.$set(k, 'phone', '')
+        //           this.$set(k, 'address', '')
+        //         })
+        //       }
+        //     }
+        //   })
+        // } else if (this.isFront === false) {
+        //   this.mainForm.pickupWay = '1'
+        // }
       })
     },
 
@@ -860,7 +908,6 @@ export default {
         pickType: Number(this.mainForm.pickupWay),
         takerId: this.mainForm.pickupMan,
         takerName: takerName || '',
-
         remark: this.mainForm.remark,
         invoiceOrderIds: orderList
       }
@@ -870,6 +917,8 @@ export default {
       if (this.mainForm.pickupWay == '2') {
         params.pickLogistics = this.mainForm.company
         params.logisticsId = this.mainForm.logisticsId
+        params.isUp = this.mainForm.isUp
+        params.isDischarge = this.mainForm.isDischarge
         // params.receivingName = this.mainForm.receivingName
         // params.phone = this.mainForm.phone
         // params.address = this.mainForm.address
@@ -900,12 +949,12 @@ export default {
 
     resetForm() {
       this.$refs.mainForm.resetFields()
-      if (this.isFront === true) {
-        this.mainForm.pickupWay = '2'
-      }
-      if (this.isFront === false) {
-        this.mainForm.pickupWay = '1'
-      }
+      // if (this.isFront === true) {
+      //   this.mainForm.pickupWay = '2'
+      // }
+      // if (this.isFront === false) {
+      //   this.mainForm.pickupWay = '1'
+      // }
       this.deliverList = []
     },
     handLogistics(row) {
@@ -925,12 +974,28 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.logistics-title{
-  padding-bottom: 10px;
+.flex {
+  display: flex;
+  div {
+    flex: 1;
+  }
+}
+::v-deep .el-timeline-item__tail {
+  border-left: 2px solid #67c23a;
+}
+::v-deep .el-form-item__content {
+  line-height: 33px;
+}
+.logistics-title {
+  padding: 10px;
 }
 .tip {
   height: 200px;
   text-align: center;
   line-height: 200px;
 }
+.pd-lr {
+  padding-left: 0 !important;
+  padding-right: 0 !important;
+}
 </style>

+ 10 - 0
src/views/supply/pickup/pickup_list.vue

@@ -153,6 +153,16 @@
                 {{ scope.row.printNum ? '已打单' : '未打单' }}
               </template>
             </el-table-column>
+            <el-table-column align="left" label="是否上楼" prop="isUp" min-width="160" show-overflow-tooltip >
+              <template v-slot="row">
+                {{ row.isUp=='YES'?'是':'否' }}
+              </template>
+            </el-table-column>
+          <el-table-column align="left" label="是否卸货" prop="isDischarge" min-width="160" show-overflow-tooltip >
+            <template v-slot="row">
+                {{ row.isDischarge=='YES'?'是':'否' }}
+              </template>
+          </el-table-column>
             <el-table-column align="left" label="打单日期" prop="printTime" min-width="160" show-overflow-tooltip />
             <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">

+ 11 - 27
src/views/supply/pickup/sum_list.vue

@@ -149,6 +149,16 @@
               {{ scope.row.printNum ? '已打单' : '未打单' }}
             </template>
           </el-table-column>
+          <el-table-column align="left" label="是否上楼" prop="isUp" min-width="160" show-overflow-tooltip >
+              <template v-slot="row">
+                {{ row.isUp=='YES'?'是':'否' }}
+              </template>
+            </el-table-column>
+          <el-table-column align="left" label="是否卸货" prop="isDischarge" min-width="160" show-overflow-tooltip >
+            <template v-slot="row">
+                {{ row.isDischarge=='YES'?'是':'否' }}
+              </template>
+          </el-table-column>
           <el-table-column align="left" label="打单日期" prop="printTime" min-width="160" show-overflow-tooltip />
           <!-- <el-table-column align="left" label="信息密钥" prop="informationKey" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
@@ -258,11 +268,6 @@
             </template>
           </el-table-column>
           <el-table-column align="left" label="备注" prop="remark" min-width="100" show-overflow-tooltip />
-          <el-table-column fixed="right" label="操作" width="100" >
-            <template slot-scope="scope">
-              <el-button v-if="scope.row.pickType != '1' " @click="handLogistics(scope.row)" type="text" size="small">物流信息</el-button>
-            </template>
-          </el-table-column>
         </el-table>
       </div>
     </div>
@@ -443,30 +448,9 @@ export default {
     handleCurrentChange(val) {
       this.currentPage = val
       this.getList()
-    },
-    handLogistics(row) {
-      getListOrderTrack({ orderId: row.invoiceId }).then(res => {
-        this.logisticsDetail = res.data
-      })
-      this.orderId = row.invoiceId
-      this.visible = true
-    },
-    onClose() {
-      this.logisticsDetail = []
-      this.orderId = ''
-      this.visible = false
     }
   }
 }
 </script>
 
-<style lang="scss" scoped>
-.logistics-title{
-  padding-bottom: 10px;
-}
-.tip{
-  height: 200px;
-    text-align: center;
-    line-height: 200px;
-}
-</style>
+<style lang="scss" scoped></style>