datetimepicker
parent
aa60103568
commit
c13f4a653a
16
README.md
16
README.md
|
|
@ -1,3 +1,19 @@
|
|||
# 宝芝堂-uniapp
|
||||
|
||||
- `pnpm install`
|
||||
|
||||
## 修改 uview-ui
|
||||
|
||||
### node_modules\uview-ui\components\u-datetime-picker\u-datetime-picker.vue
|
||||
|
||||
```vue
|
||||
<script>
|
||||
export default {
|
||||
watch: {
|
||||
value(newValue) {
|
||||
this.updateColumnValue(newValue)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,21 +1,16 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<view class="btns">
|
||||
<u-empty v-if="list.length == 0" mode="list" text="请先在后台添加分类" />
|
||||
<view class="btn" v-for="item in list" :key="item.id">
|
||||
<u-button
|
||||
:icon="`../../static/${item.key}.png`"
|
||||
:icon="item.image"
|
||||
:text="item.name"
|
||||
size="large"
|
||||
@click="itemClick(item.id)"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-grid align="center" :border="true" :col="1">
|
||||
<u-grid-item v-for="item in list" :key="item.id" :name="item.id" @click="itemClick">
|
||||
<u-image :src="`../../static/${item.key}.png`" width="40" height="40" />
|
||||
<text class="grid-text">{{item.name}}</text>
|
||||
</u-grid-item>
|
||||
</u-grid> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -28,7 +23,10 @@
|
|||
},
|
||||
onLoad() {
|
||||
const params = {_action: 'getData'}
|
||||
this.$ajax.get('/admin-api/category', { params }).then(res => {
|
||||
this.$ajax.get('/admin-api/category', {
|
||||
params,
|
||||
custom: { loading: true }
|
||||
}).then(res => {
|
||||
if (res.status == 0) {
|
||||
this.list = res.data.items
|
||||
}
|
||||
|
|
@ -45,17 +43,6 @@
|
|||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.page ::v-deep .u-grid {
|
||||
margin-top: 400rpx;
|
||||
background: white;
|
||||
}
|
||||
.page ::v-deep .u-grid-item {
|
||||
padding: 15px 0;
|
||||
}
|
||||
.page ::v-deep .grid-text {
|
||||
margin-top: 10px
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-top: 400rpx;
|
||||
display: flex;
|
||||
|
|
|
|||
|
|
@ -222,11 +222,7 @@ export default {
|
|||
toggleBirthday(name) {
|
||||
if (name) {
|
||||
this.datePicker.name = name
|
||||
const value = this.info[name]
|
||||
if (value) {
|
||||
|
||||
}
|
||||
this.datePicker.value = (new Date(value)).getTime()
|
||||
this.datePicker.value = new Date(this.info[name]).getTime()
|
||||
}
|
||||
this.datePicker.show = !this.datePicker.show
|
||||
},
|
||||
|
|
|
|||
|
|
@ -18,14 +18,14 @@
|
|||
</u-form-item>
|
||||
<u-form-item prop="birthday" label="出生年月" @click="toggleBirthday('birthday')">
|
||||
<view class="input-text">
|
||||
<text v-if="form.birthday">{{ form.birthday | date('yyy-MM-dd') }}</text>
|
||||
<text v-if="form.birthday">{{ form.birthday | date('yyyy-MM-dd') }}</text>
|
||||
<text v-else class="input-placeholder">请选择出生日期</text>
|
||||
<u-icon name="arrow-right" />
|
||||
</view>
|
||||
</u-form-item>
|
||||
<u-form-item prop="treat_at" label="初诊日期" @click="toggleBirthday('treat_at')">
|
||||
<view class="input-text">
|
||||
<text v-if="form.treat_at">{{ form.treat_at | date('yyy-MM-dd') }}</text>
|
||||
<text v-if="form.treat_at">{{ form.treat_at | date('yyyy-MM-dd') }}</text>
|
||||
<text v-else class="input-placeholder">请选择初诊日期</text>
|
||||
<u-icon name="arrow-right" />
|
||||
</view>
|
||||
|
|
@ -171,7 +171,7 @@ export default {
|
|||
this.form.sex = e.value
|
||||
},
|
||||
selectBirthday(e) {
|
||||
this.form[this.datePicker.name] = Math.floor(e.value / 1000)
|
||||
this.form[this.datePicker.name] = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
|
||||
this.toggleBirthday()
|
||||
},
|
||||
opendDoctor() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="page">
|
||||
<u--form :model="form" ref="form" labelWidth="70" :borderBottom="false">
|
||||
<u--form :model="form" ref="form" labelWidth="80" :borderBottom="false">
|
||||
<u-form-item prop="patient_id" label="姓名" :borderBottom="true">
|
||||
<view class="input-text">
|
||||
<text>{{ patient.name }}</text>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<u-radio v-for="item in typeList" :key="item.id" :label="item.name" :name="item.id" />
|
||||
</u-radio-group>
|
||||
</u-form-item>
|
||||
<u-form-item prop="form.treat_at" label="诊疗时间" :required="true" :borderBottom="true" @click="toggleDatePicker('treat_at')">
|
||||
<u-form-item prop="form.treat_at" label="诊疗时间" :required="true" :borderBottom="true" @click="toggleDatePicker('treat_at', 'datetime')">
|
||||
<view class="input-text">
|
||||
<text v-if="form.treat_at">{{ form.treat_at | date }}</text>
|
||||
<text v-else class="input-placeholder">请选择诊疗时间</text>
|
||||
|
|
@ -26,27 +26,9 @@
|
|||
</view>
|
||||
</u-form-item>
|
||||
<u-form-item prop="form.origin_price" label="划线价" :required="true" :borderBottom="true">
|
||||
<!-- <u-number-box
|
||||
v-model="form.origin_price"
|
||||
:showMinus="false"
|
||||
:showPlus="false"
|
||||
:min="0"
|
||||
decimalLength="2"
|
||||
inputWidth="100%"
|
||||
asyncChange
|
||||
/> -->
|
||||
<input type="number" v-model="form.origin_price" placeholder="输入划线价" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="form.sell_price" label="实收价" :required="true" :borderBottom="true">
|
||||
<!-- <u-number-box
|
||||
v-model="form.sell_price"
|
||||
:showMinus="false"
|
||||
:showPlus="false"
|
||||
:min="0"
|
||||
decimalLength="2"
|
||||
inputWidth="100%"
|
||||
asyncChange
|
||||
/> -->
|
||||
<input type="number" v-model="form.sell_price" placeholder="输入实收价" />
|
||||
</u-form-item>
|
||||
<u-form-item prop="order_status" label="收费情况" :required="true" :borderBottom="true">
|
||||
|
|
@ -81,7 +63,7 @@
|
|||
</u-form-item>
|
||||
<u-form-item prop="notify_at" label="通知时间" :borderBottom="true" @click="toggleDatePicker('notify_at', 'date')">
|
||||
<view class="input-text">
|
||||
<text v-if="form.notify_at">{{ form.notify_at | date }}</text>
|
||||
<text v-if="form.notify_at">{{ form.notify_at | date('yyyy-MM-dd') }}</text>
|
||||
<text v-else class="input-placeholder">请选择通知时间</text>
|
||||
<u-icon name="arrow-right" />
|
||||
</view>
|
||||
|
|
@ -314,7 +296,7 @@ export default {
|
|||
.input-text {
|
||||
color: #303133;
|
||||
font-size: 15px;
|
||||
padding: 6px 9px;
|
||||
padding: 6px 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
|
@ -326,10 +308,7 @@ export default {
|
|||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
.u-number-box {
|
||||
width: 100%;
|
||||
}
|
||||
.u-radio {
|
||||
.page ::v-deep .u-radio:not(:first) {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -65,12 +65,7 @@ export default {
|
|||
},
|
||||
onLoad(e) {
|
||||
this.patient_id = e.patient
|
||||
this.$ajax.get(`/admin-api/patient/${this.patient_id}`, { params: {_action: 'getData'}}).then(res => {
|
||||
if (res.status == 0) {
|
||||
this.patient = res.data
|
||||
uni.setNavigationBarTitle({ title: this.patient.name })
|
||||
}
|
||||
})
|
||||
this.init()
|
||||
},
|
||||
onShow() {
|
||||
this.loadData(true)
|
||||
|
|
@ -78,15 +73,20 @@ export default {
|
|||
onPullDownRefresh() {
|
||||
this.loadData(true)
|
||||
},
|
||||
onReady() {
|
||||
this.$ajax.get('/admin-api/category', { params: {_action: 'getData'}}).then(res => {
|
||||
methods: {
|
||||
async init() {
|
||||
let res
|
||||
res = await this.$ajax.get(`/admin-api/patient/${this.patient_id}`, { params: {_action: 'getData'}})
|
||||
if (res.status == 0) {
|
||||
this.patient = res.data
|
||||
uni.setNavigationBarTitle({ title: `${this.patient.name}-病历记录` })
|
||||
}
|
||||
res = await this.$ajax.get('/admin-api/category', { params: {_action: 'getData'}})
|
||||
if (res.status == 0) {
|
||||
this.typeList = res.data.items
|
||||
this.loadData()
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
this.loadData(true)
|
||||
},
|
||||
changeType(e) {
|
||||
this.typeIndex = e
|
||||
this.loadData(true)
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.4 KiB |
Loading…
Reference in New Issue