shish 3 лет назад
Родитель
Сommit
bf689ed05a

+ 4 - 3
hdApp/src/admin/order/detail.vue

@@ -17,7 +17,8 @@
       <view class="module-com order-msg">
         <view class="module-tit">
           收花人信息<text v-if="orderInfo.fromType == 4 && !$util.isEmpty(orderInfo.thirdSn)">(美团编号:{{orderInfo.thirdSn}})</text>
-          <button class="admin-button-com mini-btn" @click="edit" style="float:right;">修改</button>
+          <button class="admin-button-com mini-btn" @click="edit(orderInfo)" v-if="orderInfo.status == 1 || orderInfo.status == 2" style="float:right;">修改</button>
+          <button class="admin-button-com mini-btn default" v-else style="float:right;">修改</button>
         </view>
         <view class="module-det">
 
@@ -235,8 +236,8 @@ export default {
         }
       })
     },
-    edit(){
-      this.$msg('开发中')
+    edit(item){
+      this.$util.pageTo({url:'/admin/order/modify?id='+item.id})
     },
 		goRefund(){
 			if(this.orderInfo.payWay == 1 && this.orderInfo.onlinePay == 2){

+ 260 - 0
hdApp/src/admin/order/modify.vue

@@ -0,0 +1,260 @@
+<template>
+<view class="app-content">
+  <view class="affirm-page">
+    <view class="affirm-view overscroll">
+      <form>
+
+        <app-delivery-module ref="appDelivery" @changeAddress="changeAddress" :info.sync="orderInfo" />
+
+      </form>
+    </view>
+    <view class="under-bar">
+      <view class="price-view"></view>
+      <button class="admin-button-com blue big" @click="confirmToSubmit">提交</button>
+    </view>
+  </view>
+</view>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import productMins from "@/mixins/cgPlantProduct";
+import AppDeliveryModule from "@/components/app-delivery-modify";
+import { updateOrder } from "@/api/order";
+import { mapGetters } from "vuex";
+import { getDetB} from "@/api/order";
+export default {
+  name: "modify",
+  components: {
+    TuiListCell,AppDeliveryModule
+  },
+  mixins: [productMins],
+  data () {
+    return {
+      headers:{token:''},
+      selectJobType: "addOrder",
+      goodsPrice:'',
+      payWayindex:0,
+      payWayList:[{name:"微信",id:0},{name:"支付宝",id:1},{name:"现金",id:4},{name:"银行卡",id:5}],
+      plantClassData:[],
+      categorySelectedData:{},
+      currentImgData:[],
+      dj:'',
+      orderInfo: {}
+    };
+  },
+  onLoad (option) {
+    const token = uni.getStorageSync('token')
+    this.headers.token = token
+  },
+  computed: {
+    ...mapGetters(["getLoginInfo"])
+  },
+  methods: {
+    init() {
+      this.getDetailInfo();
+    },
+    getDetailInfo() {
+      return getDetB({ id: this.option.id }).then(res => {
+        if(res.code == 1){
+          this.orderInfo = res.data
+        }
+      })
+    },
+    //计算客户距离和运费
+    changeAddress() {
+    },
+    confirmToSubmit () {
+      let that = this
+      that.form = {...that.$refs.appDelivery.form}
+      that.$util.confirmModal({content:'确认提交?'},() => {
+          updateOrder({...that.form,id:that.orderInfo.id}).then((res) => {
+            if(res.code == 1){
+              that.$msg('修改成功')
+              setTimeout(function(){
+                uni.navigateBack()
+              },1500)
+            }
+          })
+      })
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+.module-com {
+  margin-bottom: 20upx;
+  background-color: #fff;
+  color: $fontColor2;
+  .module-tit {
+    padding: 20upx 30upx;
+    font-size: 28upx;
+  }
+  .module-det {
+    padding: 0 30upx;
+  }
+}
+.admin-button-com {
+  margin-right: 20upx;
+}
+.affirm-page {
+  position: relative;
+  height: 100%;
+  display: flex;
+  flex-direction: column;
+  .affirm-view {
+    flex: 1;
+    margin-bottom:90upx;
+    padding: 20upx;
+    background-color: #f0f2f6;
+    .commodity-view {
+      display: flex;
+      flex-direction: column;
+      .commodity-list {
+        padding: 20upx;
+        .commodity-item {
+          display: flex;
+          margin-bottom: 20upx;
+          .item-icon {
+            flex-shrink: 0;
+            width: 140upx;
+            height: 140upx;
+          }
+          .item-info {
+            display: flex;
+            flex-direction: column;
+            justify-content: center;
+            flex: 1;
+            margin-left: 20upx;
+            .info-line {
+              margin-bottom: 20upx;
+              display: flex;
+              justify-content: space-between;
+              align-items: flex-end;
+              .item-name {
+                color: #666;
+                font-size: 28upx;
+              }
+              .item-price {
+                color: #333;
+                font-size: 22upx;
+                .price {
+                  font-size: 32upx;
+                  font-weight: bold;
+                }
+              }
+              .item-type {
+                color: #999;
+                font-size: 24upx;
+              }
+              .item-count {
+                color: #666;
+                font-size: 24upx;
+              }
+            }
+          }
+        }
+      }
+      .summary-bar {
+        padding: 0 20upx;
+        height: 90upx;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        border-top: 1upx solid #eeeeee;
+        .operate-view {
+          display: flex;
+          align-items: center;
+          color: #3385ff;
+          font-size: 26upx;
+          .iconfont {
+            margin-right: 20upx;
+            font-size: 40upx;
+          }
+        }
+        .describe-view {
+          display: flex;
+          align-items: center;
+          color: #333;
+          font-size: 24upx;
+          .price {
+            font-weight: bold;
+            font-size: 36upx;
+          }
+        }
+      }
+    }
+    .module-com {
+      background-color: #fff;
+      margin-bottom: 20upx;
+      border-radius: 10upx;
+      overflow: hidden;
+					.tab-box{
+						padding: 10upx 30upx 30upx;
+						.tab{
+							width: 49%;
+							height: 70upx;
+							color: #a2a2a2;
+							border: 1upx solid #dcdcdc;
+							border-radius: 10upx;
+							font-size: 28upx;
+							font-weight: 700;
+							&.active{
+								color: #ff4d4d;
+								border: 1upx solid #ff4d4d;
+							}
+						}
+					}
+      .member-wrap {
+        .member-det {
+          font-size: 24upx;
+          margin-left: 20upx;
+        }
+      }
+      .remark-wrap {
+        align-items: flex-start;
+        .remark {
+          height: 240upx;
+        }
+      }
+    }
+  }
+  .under-bar {
+    display: flex;
+    z-index:99999;
+    justify-content: space-between;
+    align-items: center;
+    padding: 0 20upx;
+    position: fixed;
+    bottom:0;
+    /* 手机mobile屏幕小于1000px */
+    @media screen and (max-width: 1100px) {
+      width: 100%;
+    }
+    /* 收银台cashier屏幕大于1000px */
+    @media screen and (min-width:1100px) {
+      width: 40%;
+    } 
+    height: 100upx;
+    background-color: #fff;
+    box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+    .price-view {
+      display: flex;
+      align-items: center;
+      font-size: 24upx;
+      .price-title {
+        color: #333;
+      }
+      .price-number {
+        margin: 0 20upx;
+        color: #ff2842;
+        .large {
+          font-size: 40upx;
+        }
+      }
+    }
+    .admin-button-com {
+      width: 200upx;
+    }
+  }
+}
+</style>

+ 4 - 0
hdApp/src/api/order/index.js

@@ -1,5 +1,9 @@
 import https from "@/plugins/luch-request_0.0.7/request";
 
+export const updateOrder = data => {
+	return https.post("/order/update", data);
+};
+
 //获取欠款单列表 ssh 20220116
 export const getDebtOrderList = data => {
 	return https.get("/order/debt-list", data);

+ 329 - 0
hdApp/src/components/app-delivery-modify.vue

@@ -0,0 +1,329 @@
+<template>
+  <view class="app-delivery-module">
+
+    <view class="module-com">
+
+      <tui-list-cell class="line-cell" :hover="false">
+        <view class="tui-title">订花人姓名</view>
+        <input v-model="form.bookName" placeholder-class="phcolor" placeholder-style="color:#ccc;" style="width:285upx;" class="tui-input" name="bookName" placeholder="请填写姓名" />
+
+        <button class="admin-button-com default mini-btn" @click="changeFillMobile">填手机号</button>
+
+      </tui-list-cell>
+
+      <tui-list-cell class="line-cell" :hover="false" v-if="fillMobile==1">
+        <view class="tui-title">订花人手机号</view>
+        <input v-model="form.bookMobile" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" type="number" name="bookMobile" placeholder="请填写手机号" />
+      </tui-list-cell>
+
+      <tui-list-cell class="line-cell" :hover="false">
+        <view class="tui-title">配送方式</view>
+        <button @tap="form.sendType = 3" class="admin-button-com middle" :class="form.sendType == 3 ? 'blue' : 'default'">骑手送</button>
+        <button @tap="form.sendType = 2" class="admin-button-com middle" style="margin-left:15upx;" :class="form.sendType == 2 ? 'blue' : 'default'">自己送</button>
+        <button @tap="form.sendType = 1" class="admin-button-com middle" style="margin-left:15upx;" :class="form.sendType == 1 ? 'blue' : 'default'">到店自取</button>
+      </tui-list-cell>
+
+      <template>
+          <tui-list-cell class="line-cell" :hover="false" :arrow="true">
+            <view class="tui-title" v-if="form.sendType == 1">取花日期</view>
+            <view class="tui-title" v-else>配送日期</view>
+            <picker mode="date" :value="form.reachDate" @change="selTimeFn" class="tui-input">
+              <view v-if="form.reachDate">{{ form.reachDate }}</view>
+              <view v-else>今天</view>
+            </picker>
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false" :arrow="false">
+            <view class="tui-title" v-if="form.sendType == 1">取花时间</view>
+            <view class="tui-title" v-else>配送时间</view>
+            <picker mode="multiSelector" :value="form.reachPeriod" :range="timeOptions" @change="bindTimeChange">
+              <view class="uni-input" style="width:450upx;">{{form.reachPeriod}}<text style="margin-left:10upx;">前</text></view>
+            </picker>
+          </tui-list-cell>
+      </template>
+
+      <tui-list-cell class="line-cell" :hover="false">
+        <view class="tui-title">贺卡内容</view>
+        <input v-model="form.cardInfo" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="cardInfo" placeholder="选填项" />
+      </tui-list-cell>
+
+      <template v-if="form.sendType != 1">
+
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">收花人姓名</view>
+          <input v-model="form.receiveUserName" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="receiveUserName" placeholder="请填写姓名" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">收花人手机号</view>
+          <input v-model="form.receiveMobile" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" type="number" name="receiveMobile" placeholder="请填写手机号" />
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selectCityFn">
+          <view class="tui-title">所在城市</view>
+          <view class="tui-input" v-if="form.province || form.city" >{{ form.province + '-' + form.city }}</view> <view class="tui-placeholder" v-else>请选择</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false" :arrow="true" @click="selRegionFn">
+          <view class="tui-title">详细地址</view>
+          <view class="tui-input" v-if="form.address">{{ form.address }}</view>
+          <view class="tui-placeholder" v-else>请填写地址</view>
+        </tui-list-cell>
+
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="tui-title">门牌号</view>
+          <input v-model="form.floor" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="floor" placeholder="楼号门牌号(选填)" />
+        </tui-list-cell>
+
+      </template>
+
+      <template v-if="form.sendType != 1">
+        <tui-list-cell class="line-cell" :hover="false">
+          <view class="none-name-delivery flex-center" style="padding-left:0upx;">
+            <view class="tui-title">匿名派送</view>
+            <checkbox-group @change="anonymityChange" style="padding-left:70upx;">
+            <checkbox class="ljd-checkbox" value="1" :checked="form.anonymity == 1" style="transform:scale(0.6,0.6)" id="noneNameText" ></checkbox>
+            <label for="noneNameText" class="none-name-text">需要</label>
+            </checkbox-group>
+          </view>
+        </tui-list-cell>
+      </template>
+
+      <tui-list-cell class="line-cell" :hover="false">
+        <view class="tui-title">备注</view>
+        <textarea style="min-height:100upx;height:auto;" v-model="form.remark" placeholder="选填" />
+      </tui-list-cell>
+
+    </view>
+
+    <!-- 省市联动 -->
+    <simple-address ref="simpleAddress" :region="regionTree" :pickerValueDefault="cityPickerValueDefault" @onConfirm="getCityConfirm" ></simple-address>
+
+    <!-- 选择详细地址 -->
+    <app-area-sel :show.sync="showRegion" :city="form.city" @change="changeAreaFn" />
+
+  </view>
+</template>
+
+<script>
+import { mapGetters } from "vuex";
+import TuiListCell from "@/components/plugin/list-cell";
+import AppDatePicker from "@/components/app-date-picker";
+import SimpleAddress from "@/components/plugin/simple-address";
+import AppAreaSel from "@/components/app-area-sel";
+import AppBindInfo from "@/components/app-bind-info";
+import {getShop} from "@/api/common"
+import {getRegion} from "@/api/shop"
+export default {
+  name: "app-delivery-module",
+  components: {
+    AppAreaSel,
+    TuiListCell,
+    AppDatePicker,
+    SimpleAddress,
+    AppBindInfo
+  },
+	props: {
+		info: {
+			type: Object,
+			default: {}
+		},
+  },
+  data() {
+    return {
+      fillMobile:0,
+      region: [],
+      showRegion: false,
+      form: {
+        sendType:3,
+        receiveUserName: "",
+        receiveMobile: "",
+        province: "",
+        city: "",
+        address: "",
+        showAddress:"",
+        floor: "",
+        fullAddress: "",
+        bookName: '',
+        bookMobile: "",
+        reachDate: '',
+        reachPeriod: "12:00",
+        cardInfo: "",
+        remark: "",
+        anonymity:0,
+        lat:'',
+        long:''
+      },
+      region: {latitude: 0,longitude: 0},
+      regionTree:[],
+      cityPickerValueDefault: [0, 0],
+      timeOptions: [
+			['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],
+			['00', '05', '10','15','20','25','30','35','40','45','50','55']
+		],
+    };
+  },
+  mounted() {
+    let that = this
+    getRegion().then(res=>{
+      if(res.code == 1){
+        that.regionTree = res.data.region
+        getShop().then(res=>{
+          if(res.code == 1){
+            if(res.data.info){
+              that.form.province = res.data.info.province
+              that.form.city = res.data.info.city
+            }
+          }
+        })
+      }
+    })
+  },
+	watch: {
+		info: {
+			handler: function(newVal) {
+        if(!this.$util.isEmpty(newVal)){
+          this.form.bookName = newVal.bookName
+          if(!this.$util.isEmpty(newVal.bookMobile)){
+            this.fillMobile = 1
+          }else{
+            this.fillMobile = 0
+          }
+          this.form.bookMobile = newVal.bookMobile
+          this.form.sendType = newVal.sendType
+          if(!this.$util.isEmpty(newVal.reachDate)){
+            this.form.reachDate = newVal.reachDate
+          }
+          if(!this.$util.isEmpty(newVal.reachPeriod)){
+            this.form.reachPeriod = newVal.reachPeriod
+          }
+
+          this.form.cardInfo = newVal.cardInfo
+          this.form.receiveUserName = newVal.receiveUserName
+          this.form.receiveMobile = newVal.receiveMobile
+          this.form.province = newVal.province
+          this.form.city = newVal.city
+          this.form.address = newVal.address
+          this.form.showAddress = newVal.showAddress;
+          this.form.floor = newVal.floor
+          this.form.remark = newVal.remark
+          this.form.anonymity = newVal.anonymity
+
+          this.form.lat = newVal.lat
+          this.form.long = newVal.long
+
+        }
+			},
+			immediate:true
+		}
+	},
+  methods: {
+    changeFillMobile(){
+      this.fillMobile = this.fillMobile == 0 ? 1 : 0
+    },
+    bindTimeChange(event){
+      let val = event.detail.value
+      let before = Number(val[0])
+      let after = Number(val[1])
+      let timeOptions = this.timeOptions
+      this.form.reachPeriod = timeOptions[0][before]+':'+timeOptions[1][after]
+    },
+    selTimeFn(e) {
+      this.form.reachDate = e.detail.value;
+    },
+    // 选择地址
+    selRegionFn() {
+      if (!this.form.city) {
+        this.$msg("请选择城市");
+        return false;
+      }
+      this.showRegion = true;
+    },
+    changeAreaFn(e) {
+      this.form.address = e.title;
+      this.form.showAddress = e.address;
+      this.form.lat = e.location.lat;
+      this.form.long = e.location.lng;
+    },
+    timeTodaySelFn(index) {
+      this.form.reachPeriod = index;
+    },
+    anonymityChange() {
+      this.form.anonymity = this.form.anonymity == 1 ? 0 : 1;
+    },
+    selectCityFn() {
+      this.$refs.simpleAddress.open();
+    },
+    getCityConfirm(e) {
+      this.form.province = e.provinceName;
+      this.form.city = e.cityName;
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-delivery-module {
+  .module-com {
+    margin-bottom: 20upx;
+    background-color: #fff;
+    .module-tit {
+      padding: 20upx 18upx;
+      font-size: 28upx;
+      font-weight: 600;
+      border-bottom: 1px solid $borderColor;
+    }
+    .module-det {
+      padding: 0 30upx;
+    }
+  }
+  // 公共
+  .line-cell {
+    .tui-title {
+      width: 210upx;
+      color: $fontColor2;
+    }
+    .tui-input {
+      width: calc(100% - 210upx);
+      font-size: 28upx;
+    }
+    .tui-placeholder {
+      color: #ccc;
+    }
+    .phcolor {
+      color: #ccc;
+    }
+  }
+  .delivery-time {
+    @include disFlex(center, center);
+    .button-com {
+      padding-top: 14upx;
+      padding-bottom: 10upx;
+      margin-right:10upx;
+    }
+  }
+  // 贺卡
+  .gift-wrap {
+    .gift-content {
+      width: 100%;
+    }
+    .need-gift {
+      margin-left: 14upx;
+      color: $fontColor2;
+    }
+    .gitf-textarea {
+      margin-top: 40upx;
+    }
+  }
+
+  // 匿名派送
+  .none-name-delivery {
+    margin-bottom: 20upx;
+    background-color: #fff;
+    .none-name-text {
+      margin-left: 10upx;
+      color: $fontColor2;
+    }
+  }
+}
+</style>

+ 2 - 4
hdApp/src/components/app-delivery.vue

@@ -90,13 +90,11 @@
         </tui-list-cell>
       </template>
 
-    </view>
-
-    <view class="module-com remark-wrap">
       <tui-list-cell class="line-cell" :hover="false">
         <view class="tui-title">备注</view>
-        <input v-model="form.remark" placeholder-class="phcolor" class="tui-input" placeholder-style="color:#ccc" name="remark" placeholder="选填" />
+        <textarea style="min-height:100upx;height:auto;" v-model="form.remark" placeholder="选填" />
       </tui-list-cell>
+
     </view>
 
     <!-- 省市联动 -->

+ 2 - 1
hdApp/src/pages.json

@@ -304,7 +304,8 @@
 				{ "path": "ship", "style": { "navigationBarTitleText": "发货" } },
 				{ "path": "fill-form", "style": { "navigationBarTitleText": "填写收花人" } },
 				{ "path": "debtList", "style": { "navigationBarTitleText": "待结订单" } },
-				{ "path": "workOrder", "style": { "navigationBarTitleText": "开单" } }
+				{ "path": "workOrder", "style": { "navigationBarTitleText": "开单" } },
+				{ "path": "modify", "style": { "navigationBarTitleText": "修改" } }
 			]
 		},
 		{