|
|
|
|
@ -53,6 +53,26 @@
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 订单选择-->
|
|
|
|
|
<view class="service-time">
|
|
|
|
|
<view class="title">
|
|
|
|
|
订单选择
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="line"></view>
|
|
|
|
|
|
|
|
|
|
<view class="time-content" @click="showOrderSelect = true">
|
|
|
|
|
<view>
|
|
|
|
|
<span>订单</span><span style="color: red;">*</span>
|
|
|
|
|
<view style="margin-top: 10rpx;">
|
|
|
|
|
<u-tag mode="dark" type="primary" v-if="form.order_id" :text="form.order"></u-tag>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-icon name="arrow-right" label="请选择" label-pos="left"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 护理项目-->
|
|
|
|
|
<view class="sku-list">
|
|
|
|
|
<view class="title">
|
|
|
|
|
@ -120,6 +140,8 @@
|
|
|
|
|
:params="params"
|
|
|
|
|
@confirm="confirm"></u-picker>
|
|
|
|
|
<u-select v-model="showAddressSelect" :list="vuex_selected_customer.customer_address" value-name="id" label-name="address" @confirm="pickAddress"></u-select>
|
|
|
|
|
<u-select v-model="showOrderSelect" :list="getNowOrder" value-name="id" label-name="product_name" @confirm="pickOrder"></u-select>
|
|
|
|
|
|
|
|
|
|
<u-toast ref="uToast" />
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
@ -131,6 +153,7 @@ import {isNum} from "@/uview-ui/components/u-avatar-cropper/weCropper";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
showOrderSelect: false,
|
|
|
|
|
showAddressSelect: false,
|
|
|
|
|
pickerType: 1,//1开始,2结束
|
|
|
|
|
showTimePicker: false,
|
|
|
|
|
@ -147,6 +170,19 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
getNowOrder () {
|
|
|
|
|
if (this.vuex_selected_customer.orders instanceof Array) {
|
|
|
|
|
return this.vuex_selected_customer.orders.filter(i => {
|
|
|
|
|
let now = this.$moment().valueOf()
|
|
|
|
|
return (this.$moment(i.start_date).valueOf() <= now) && (this.$moment(i.end_date).valueOf() >= now)
|
|
|
|
|
}).map(i => ({
|
|
|
|
|
...i,
|
|
|
|
|
product_name: i.product?.name
|
|
|
|
|
}))
|
|
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
serviceTime () {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
@ -162,8 +198,8 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mySkus () {
|
|
|
|
|
const orderSku = this.getOrder()?.product_type?.sku_category?.map(i => i.sku)?.flat() || []
|
|
|
|
|
console.log(333,orderSku)
|
|
|
|
|
const orderSku = this.getNowOrder.find(i => i.id === this.form.order_id)?.product_type?.sku_category?.map(i => i.sku)?.flat() || []
|
|
|
|
|
//const orderSku = this.getOrder()?.product_type?.sku_category?.map(i => i.sku)?.flat() || []
|
|
|
|
|
return this.vuex_user.nurse_sku_links.map(i => i.sku).filter(i => orderSku.find(j => j.id === i.id))
|
|
|
|
|
},
|
|
|
|
|
params () {
|
|
|
|
|
@ -240,6 +276,11 @@ export default {
|
|
|
|
|
this.form.address = e[0].label;
|
|
|
|
|
this.form.address_id = e[0].value;
|
|
|
|
|
},
|
|
|
|
|
pickOrder (e) {
|
|
|
|
|
this.form.order_id = e[0].value;
|
|
|
|
|
this.form.order = e[0].label;
|
|
|
|
|
this.form.product_id = this.getNowOrder.find(i => i.id === this.order_id)?.product_id;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
submit () {
|
|
|
|
|
if (this.vuex_selected_customer.status !== 1) {
|
|
|
|
|
@ -271,10 +312,11 @@ export default {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const order = this.getOrder()
|
|
|
|
|
if (order.id && order.product_id) {
|
|
|
|
|
this.form.order_id = order.id
|
|
|
|
|
this.form.product_id = order.product_id
|
|
|
|
|
//const order = this.getOrder()
|
|
|
|
|
//if (order.id && order.product_id) {
|
|
|
|
|
//this.form.order_id = order.id
|
|
|
|
|
//this.form.product_id = order.product_id
|
|
|
|
|
if (this.form.order_id && this.form.product_id) {
|
|
|
|
|
this.form.customer_id = this.vuex_selected_customer.id
|
|
|
|
|
this.$u.api.scheduleSave(this.form).then(res => {
|
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
|
|