| xqd
@@ -50,14 +50,17 @@
|
|
|
</view>
|
|
|
<view class="nr">
|
|
|
<view class="left">订单状态:</view>
|
|
|
- <view class="right" v-if="zt==0">未履行</view>
|
|
|
- <view class="right" v-else-if="zt==1">已完成</view>
|
|
|
+ <view class="right" v-if="zt==1">未支付</view>
|
|
|
+ <view class="right" v-else-if="zt==2">待接单</view>
|
|
|
+ <view class="right" v-else-if="zt==3">进行中</view>
|
|
|
+ <view class="right" v-else-if="zt==4">已完成</view>
|
|
|
+ <view class="right" v-else-if="zt==5">已取消</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-gap height="30" bg-color="#f6f6f6"></u-gap>
|
|
|
<!-- 底部按钮 -->
|
|
|
<!-- 当订单状态为未接单 zt==0 -->
|
|
|
- <view class="bottomButton" v-if="zt == 0">
|
|
|
+ <view class="bottomButton" v-if="zt <= 2">
|
|
|
<!-- 左边的首页按钮 -->
|
|
|
<view style="width: 20%;" class="flex align-center justify-center">
|
|
|
<u-icon name="home" size="50" @click="home"></u-icon>
|
| xqd
@@ -65,12 +68,24 @@
|
|
|
<!-- 右边的其他按钮 -->
|
|
|
<view style="width: 80%;" class="flex justify-end align-center">
|
|
|
<view class="b">
|
|
|
- <u-button shape="circle" :custom-style="btStyle" @click="queren">确认订单</u-button>
|
|
|
+ <u-button shape="circle" :custom-style="btStyle" @click="queren">确认接单</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 当订单状态为 zt==1 -->
|
|
|
- <view class="bottomButton" v-else-if="zt == 1">
|
|
|
+ <view class="bottomButton" v-else-if="zt == 3">
|
|
|
+ <!-- 左边的首页按钮 -->
|
|
|
+ <view style="width: 20%;" class="flex align-center justify-center">
|
|
|
+ <u-icon name="home" size="50" @click="home"></u-icon>
|
|
|
+ </view>
|
|
|
+ <!-- 右边的其他按钮 -->
|
|
|
+ <view style="width: 80%;" class="flex justify-end align-center">
|
|
|
+ <view class="b">
|
|
|
+ <u-button shape="circle" :custom-style="btStyle" @click="querenok" >确认完成</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="bottomButton" v-else-if="zt > 3">
|
|
|
<!-- 左边的首页按钮 -->
|
|
|
<view style="width: 20%;" class="flex align-center justify-center">
|
|
|
<u-icon name="home" size="50" @click="home"></u-icon>
|
| xqd
@@ -82,18 +97,34 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
onLoad(options) {
|
|
|
+ let ids = options.data;
|
|
|
+ if(ids!=''&&ids!=0){
|
|
|
+ this.xhrId = ids;
|
|
|
+ // 执行渲染
|
|
|
+ this.getInfos(ids);
|
|
|
+
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:'请求错误',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log('详情:',options);
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ xhrId:0,
|
|
|
// 上部数据
|
|
|
orderID: 'ZX202000010', //订单号
|
|
|
|
| xqd
@@ -106,6 +137,7 @@
|
|
|
placeTime: '', //下单时间
|
|
|
xiadankh: '张大', //下单客户
|
|
|
zt: 0, // 状态 0未履行 1已完成
|
|
|
+ local:'',
|
|
|
|
|
|
//下部按钮样式
|
|
|
bStyle: {
|
| xqd
@@ -123,9 +155,79 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 确认订单
|
|
|
- queren(e) {
|
|
|
- this.zt = 1
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 详情渲染
|
|
|
+ * @author Liu Yuanhang
|
|
|
+ * @param {Object} id
|
|
|
+ */
|
|
|
+ getInfos:async function(id){
|
|
|
+ // 获取信息
|
|
|
+ let res = await this.$request.post("patient/orderPatientDetail",{patient_id:id});
|
|
|
+ if(res.status==0){
|
|
|
+ let datas = res.data;
|
|
|
+ this.orderID = datas.order_sn;
|
|
|
+ this.name = datas.name;
|
|
|
+ this.age = datas.numbirthday;
|
|
|
+ this.ID = datas.card_number;
|
|
|
+ this.appointment = datas.appoint_time;
|
|
|
+ this.placeTime = datas.created_at;
|
|
|
+ this.xiadankh = datas.nickname;
|
|
|
+ this.zt = datas.order_status;
|
|
|
+ this.local = datas.organization;
|
|
|
+
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:res.message,
|
|
|
+ duration:3000
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 接单
|
|
|
+ * @author Liu Yuanhang
|
|
|
+ * @param {Object} e
|
|
|
+ */
|
|
|
+ queren:async function(e) {
|
|
|
+ this.zt = 3;
|
|
|
+ let res = await this.$request.post("patient/putOrderPatient",{order_id:this.xhrId});
|
|
|
+ console.log('接单:',res);
|
|
|
+ if(res.status==0){
|
|
|
+ uni.showToast({
|
|
|
+ title:"接单成功!",
|
|
|
+ duration:3000
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:res.message,
|
|
|
+ duration:3000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 门诊预约完成订单
|
|
|
+ * @author Liu Yuanhang
|
|
|
+ */
|
|
|
+ querenok:async function(){
|
|
|
+ this.zt = 4;
|
|
|
+ let res = await this.$request.post("patient/mzPatientok",{order_id:this.xhrId});
|
|
|
+ console.log('完成接单:',res);
|
|
|
+ if(res.status==0){
|
|
|
+ uni.showToast({
|
|
|
+ title:"操作成功!",
|
|
|
+ duration:3000
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:res.message,
|
|
|
+ duration:3000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log('确认订单完成')
|
|
|
},
|
|
|
home(e){
|
|
|
uni.switchTab({
|