Browse Source

经销商盲票订单部分新增配送方式

DELL 3 years ago
parent
commit
f6cac924c3

+ 29 - 14
src/views/order/channel/components/ExpressEdit.vue

@@ -12,7 +12,21 @@
         :rules="rules"
         label-width="100px"
       >
-        <el-form-item label="快递公司:" prop="deliveryId">
+        <el-form-item label="配送方式:" prop="deliveryId">
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="1">快递发货</el-radio>
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="2">无需物流</el-radio>
+        </el-form-item>
+
+        <el-form-item v-if="shipForm.deliveryType == 1"  label="快递单号:" prop="deliveryFlowId">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 300px"
+          />
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1"  label="快递公司:" prop="deliveryId">
           <el-select
             v-model="shipForm.deliveryId"
             placeholder="请选择快递公司"
@@ -28,15 +42,6 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="快递单号:" prop="deliveryFlowId">
-          <el-input
-            v-model="shipForm.deliveryFlowId"
-            placeholder="输入快递单号"
-            clearable
-            size="small"
-            style="width: 300px"
-          />
-        </el-form-item>
       </el-form>
       <!-- 按钮 -->
       <div slot="footer" class="dialog-footer">
@@ -74,15 +79,16 @@ export default {
       shipForm: {
         deliveryId: "",
         deliveryFlowId: "",
+        deliveryType: "1",
       },
       // 快递下拉列表
       companyData: [],
       rules: {
         deliveryId: [
-          { required: true, message: "请选择快递公司", trigger: "change" },
+          { required: false, message: "请选择快递公司", trigger: "change" },
         ],
         deliveryFlowId: [
-          { required: true, message: "请输入快递单号", trigger: "blur" },
+          { required: false, message: "请输入快递单号", trigger: "blur" },
         ],
       },
     };
@@ -95,8 +101,9 @@ export default {
     getFormData(){
       this.shipForm.deliveryId = this.goodsInfo.deliveryId
       this.shipForm.deliveryFlowId = this.goodsInfo.deliveryFlowId
+      this.shipForm.deliveryType = this.goodsInfo.deliveryType
     },
-    
+
     // 关闭发货弹框
     close() {
       this.$emit("close");
@@ -104,6 +111,14 @@ export default {
       this.$refs["shipForm"].resetFields();
     },
 
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -148,4 +163,4 @@ export default {
 };
 </script>
 <style scoped>
-</style>
+</style>

+ 33 - 11
src/views/order/channel/components/SendGoods.vue

@@ -20,7 +20,22 @@
             `${goodsInfo.receiver},${goodsInfo.tel},${goodsInfo.province}${goodsInfo.city}${goodsInfo.area}${goodsInfo.address}`
           }}</span>
         </el-form-item>
-        <el-form-item label="快递公司:" prop="deliveryId">
+        <el-form-item label="配送方式:">
+          <!--单选框-->
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="1">快递发货</el-radio>
+          <el-radio @change="radioDistribution" v-model="shipForm.deliveryType" label="2">无需物流</el-radio>
+
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1" label="快递单号:" prop="deliveryFlowId">
+          <el-input
+            v-model="shipForm.deliveryFlowId"
+            placeholder="输入快递单号"
+            clearable
+            size="small"
+            style="width: 500px"
+          />
+        </el-form-item>
+        <el-form-item v-if="shipForm.deliveryType == 1"  label="快递公司:" prop="deliveryId">
           <el-select
             v-model="shipForm.deliveryId"
             placeholder="请选择快递公司"
@@ -36,15 +51,6 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="快递单号:" prop="deliveryFlowId">
-          <el-input
-            v-model="shipForm.deliveryFlowId"
-            placeholder="输入快递单号"
-            clearable
-            size="small"
-            style="width: 500px"
-          />
-        </el-form-item>
         <el-form-item label="盲票组:">
           <el-select
             v-model="shipForm.boxId"
@@ -157,6 +163,7 @@ export default {
         deliveryId: "",
         deliveryFlowId: "",
         boxId: "",
+        deliveryType:"1",//物流配送方式单选框
       },
       // 快递下拉列表
       companyData: [],
@@ -182,6 +189,21 @@ export default {
       this.list = [];
       this.shipForm.boxId = "";
       this.$refs["shipForm"].resetFields();
+      this.shipForm.deliveryType = "1";
+    },
+
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+        this.shipForm.boxId = "";
+        this.list = [];
+      }
+      if(this.shipForm.deliveryType == '1'){
+        this.shipForm.boxId = "";
+        this.list = [];
+      }
     },
 
     // 快递下拉列表
@@ -275,4 +297,4 @@ export default {
   align-items: center;
   justify-content: space-between;
 }
-</style>
+</style>

+ 12 - 2
src/views/order/channel/detail.vue

@@ -84,6 +84,15 @@
             @click="toGoods()"
             >发货</el-button
           >
+          <!--              ============================================================================================改-->
+
+          <div class="info-item-content-one" v-if="status.value === 2">
+            <div class="title">配送方式:</div>
+            <div class="txt">
+<!--              {{ info.deliveryType || "&#45;&#45;" }}-->
+              {{ "快递发货" || "--" }}
+            </div>
+          </div>
           <div class="info-item-content-one" v-if="status.value === 2">
             <div class="title">快递公司:</div>
             <div class="txt">
@@ -168,10 +177,11 @@
       :goods-info="info"
       @close="close"
     />
+
   </div>
 </template>
 <script>
-import { orderDetail, channelList } from "@/api/business/order";
+import { orderDetail, boxList } from "@/api/business/order";
 import { publicFileGetUrl } from "@/api/common";
 import { accMul } from "@/utils/util";
 import SendGoods from "./components/SendGoods";
@@ -218,7 +228,7 @@ export default {
   methods: {
     // 盲票组列表
     getChannelList(row) {
-      channelList({ orderId: this.orderId }).then((res) => {
+      boxList({ orderId: this.orderId }).then((res) => {
         this.boxData = res.data;
       });
     },