|
@@ -3,21 +3,22 @@
|
|
|
<view class="form">
|
|
|
<view class="form_group">
|
|
|
<view class="lable">所属科室</view>
|
|
|
- <input v-model="item.title" placeholder="请输入标题" />
|
|
|
+ <input :value="user.dept.deptName || '无科室'" disabled />
|
|
|
</view>
|
|
|
<view class="form_group">
|
|
|
<view class="lable">随访模板</view>
|
|
|
- <picker :range="templateList" range-key="title" @change="picker($event, 'type')">
|
|
|
- <input placeholder="请选择" v-model="item.type" :disabled="true" />
|
|
|
+ <picker :range="templateList" range-key="title" @change="picker">
|
|
|
+ <input placeholder="请选择" v-model="item.templateName" :disabled="true" />
|
|
|
<view class="icon more"></view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
<view class="form_group">
|
|
|
- <view class="lable">随访模板</view>
|
|
|
- <picker @change="picker($event, 'type')">
|
|
|
- <input placeholder="请选择" v-model="item.type" :disabled="true" />
|
|
|
+ <view class="lable">指定患者</view>
|
|
|
+ <picker @click="go()" disabled v-if="item.patientList">
|
|
|
+ <input placeholder="请选择" :value="item.patientList.length > 0 ? '已选择:' + item.patientList.length + '人' : ''" :disabled="true" />
|
|
|
<view class="icon more"></view>
|
|
|
</picker>
|
|
|
+ <input :value="item.patientName" v-else />
|
|
|
</view>
|
|
|
</view>
|
|
|
<button class="btn" @click="add()">确认</button>
|
|
@@ -28,30 +29,35 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- item: { state: 0 },
|
|
|
+ user: this.getUser(),
|
|
|
+ item: { templateName: '', patientList: [] },
|
|
|
templateList: []
|
|
|
};
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
+ this.item.type = e.type || 0;
|
|
|
this.getTemplateList();
|
|
|
- if (e.id) {
|
|
|
- this.http.request({
|
|
|
- url: '/work/knowledge/detail/' + e.id,
|
|
|
- success: (res) => {
|
|
|
- this.item = res.data.data;
|
|
|
- this.$refs.editor.setContents();
|
|
|
- uni.setNavigationBarTitle({ title: '编辑知识库' });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ this.getDeatil(e);
|
|
|
+ uni.$on('selectUser', (res) => {
|
|
|
+ this.item.patientList = res;
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
- picker(e, tag) {
|
|
|
- if (tag == 'type') {
|
|
|
- this.item.type = this.type[e.detail.value].dictLabel;
|
|
|
- } else {
|
|
|
- this.item[tag] = e.detail.value;
|
|
|
+ getDeatil(e) {
|
|
|
+ if (e.id) {
|
|
|
+ this.http.request({
|
|
|
+ url: '/work/record/detail/' + e.id,
|
|
|
+ success: (res) => {
|
|
|
+ this.item = res.data.data;
|
|
|
+ this.item.patientName = e.patientName;
|
|
|
+ uni.setNavigationBarTitle({ title: '编辑随访' });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+ },
|
|
|
+ picker(e, tag) {
|
|
|
+ this.item.templateName = this.templateList[e.detail.value].title;
|
|
|
+ this.item.op = this.templateList[e.detail.value].op;
|
|
|
this.$forceUpdate();
|
|
|
},
|
|
|
getTemplateList() {
|
|
@@ -62,18 +68,22 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ go() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/follow/doctor/selectUser?selected=' + JSON.stringify(this.item.patientList)
|
|
|
+ });
|
|
|
+ },
|
|
|
add() {
|
|
|
let rule = [
|
|
|
- { name: 'title', checkType: 'notnull', errorMsg: '请输入标题' },
|
|
|
- { name: 'type', checkType: 'notnull', errorMsg: '请选择分类' },
|
|
|
- { name: 'content', checkType: 'notnull', errorMsg: '请输入内容' }
|
|
|
+ { name: 'templateName', checkType: 'notnull', errorMsg: '请选择随访模板' },
|
|
|
+ { name: 'patientList', checkType: 'notnull', errorMsg: '请选择患者' }
|
|
|
];
|
|
|
if (!this.verify.check(this.item, rule)) {
|
|
|
uni.showModal({ content: this.verify.error, showCancel: false });
|
|
|
return false;
|
|
|
}
|
|
|
this.http.request({
|
|
|
- url: this.item.id ? '/work/knowledge/edit' : '/work/knowledge/add',
|
|
|
+ url: this.item.id ? '/work/record/edit' : '/work/record/add',
|
|
|
method: 'POST',
|
|
|
data: this.item,
|
|
|
success: (res) => {
|
|
@@ -82,7 +92,7 @@ export default {
|
|
|
content: '操作成功',
|
|
|
showCancel: false,
|
|
|
success: (res) => {
|
|
|
- uni.$emit('knowledge');
|
|
|
+ uni.$emit('record');
|
|
|
uni.navigateBack();
|
|
|
}
|
|
|
});
|