Explorar o código

商品提货订单部分新增配送方式

DELL %!s(int64=3) %!d(string=hai) anos
pai
achega
a4410e0bdd

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

@@ -12,7 +12,20 @@
         :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 +41,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">
@@ -79,15 +83,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" },
         ],
       },
     };
@@ -100,8 +105,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");
@@ -109,6 +115,15 @@ export default {
       this.$refs["shipForm"].resetFields();
     },
 
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
+
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -154,4 +169,4 @@ export default {
 };
 </script>
 <style scoped>
-</style>
+</style>

+ 32 - 12
src/views/order/deliver/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
+            @blur="InputBlur()"
+            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="请选择快递公司"
@@ -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: 300px"
-          />
-        </el-form-item>
       </el-form>
       <!-- 商品 -->
       <el-table
@@ -82,7 +88,7 @@
         </el-table-column>
         <el-table-column label="发货状态">
           <template slot-scope="{ row }">
-            <div>{{ row.deliveryFlowId ? "已发货" : "未发货" }}</div>
+            <div>{{ row.deliveryTime ? "已发货" : "未发货" }}</div>
           </template>
         </el-table-column>
       </el-table>
@@ -121,6 +127,7 @@ export default {
       shipForm: {
         deliveryId: "",
         deliveryFlowId: "",
+        deliveryType:"1",
       },
       // 快递下拉列表
       companyData: [],
@@ -147,6 +154,19 @@ export default {
       this.$refs["shipForm"].resetFields();
     },
 
+    //切换配送方式时清空另一个方式所选项
+    radioDistribution(){
+      if(this.shipForm.deliveryType == '2'){
+        this.shipForm.deliveryId = '';
+        this.shipForm.deliveryFlowId = '';
+      }
+    },
+
+    //快递单号失去焦点时
+    InputBlur(){
+      //调用自动查询快递公司接口,渲染到页面上
+    },
+
     // 快递下拉列表
     getCompanyList() {
       companyList({}).then((res) => {
@@ -211,4 +231,4 @@ export default {
 };
 </script>
 <style>
-</style>
+</style>

+ 8 - 2
src/views/order/deliver/detail.vue

@@ -85,9 +85,15 @@
           v-for="(item, index) in deliverList"
           :key="index"
         >
-          <div class="logistics-title">快递{{ index + 1 }}</div>
+          <div class="logistics-title">包裹{{ index + 1 }}</div>
           <div class="info">
             <div class="info-one">
+<!--============================================================================================改-->
+              <div class="tit">配送方式:</div>
+              <div class="txt">{{ item.companyName || item.deliveryFlowId ? "快递发货":"无需物流" }}</div>
+<!--              <div class="txt">{{ "快递发货" || "&#45;&#45;" }}</div>-->
+            </div>
+            <div class="info-one">
               <div class="tit">快递公司:</div>
               <div class="txt">{{ item.companyName || "--" }}</div>
             </div>
@@ -143,7 +149,7 @@
           </el-table-column>
           <el-table-column label="状态">
             <template slot-scope="{ row }">
-              <div>{{ row.deliveryFlowId ? "已发货" : "未发货" }}</div>
+              <div>{{ row.deliveryTime ? "已发货" : "未发货" }}</div>
             </template>
           </el-table-column>
         </el-table>

+ 13 - 1
src/views/order/deliver/index.vue

@@ -50,6 +50,16 @@
         >
         </el-date-picker>
       </el-form-item>
+      <el-form-item label="收货人手机">
+        <el-input
+          v-model="queryParams.tel"
+          placeholder="输入手机号"
+          clearable
+          size="small"
+          style="width: 240px"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button
           type="primary"
@@ -218,6 +228,7 @@ export default {
         startTime: "",
         endTime: "",
         status: "",
+        tel:"",
       },
       // 分页
       pageParams: {
@@ -288,6 +299,7 @@ export default {
         startTime: "",
         endTime: "",
         status: "",
+        tel: "",
       };
       this.state = "no"
       this.tradeTimeArr = [];
@@ -367,4 +379,4 @@ export default {
 .ge {
   height: 20px;
 }
-</style>
+</style>