|
|
@ -78,7 +78,7 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-else :key="itemIndex"> |
|
|
|
<view class="flex justify-between text-sm py-3 px-4 border-b items-center"> |
|
|
|
<view class="flex justify-between text-sm py-3 border-b items-center"> |
|
|
|
{{ colItem.name }} |
|
|
|
<view>{{ colItem.value }}</view> |
|
|
|
</view> |
|
|
@ -86,8 +86,10 @@ |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
<view class="p-4"> |
|
|
|
<u-button type="primary" @click="submit(0)" v-if="!disabled">开始填表</u-button> |
|
|
|
<u-button type="primary" @click="submit(1)" v-if="disabled && detail.zaritPoint === null">继续填表</u-button> |
|
|
|
<u-button type="primary" @click="submit" v-if="!disabled">开始填表</u-button> |
|
|
|
<u-button type="primary" @click="handleFinishNum(detail.id)" v-if="disabled && detail.zaritPoint === null && detail.selfFill === 1"> |
|
|
|
继续填表 |
|
|
|
</u-button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -128,7 +130,7 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
...mapMutations('yanyuan', ['setCode', 'setReportId']), |
|
|
|
...mapActions('yanyuan', ['handleQuestion']), |
|
|
|
...mapActions('yanyuan', ['handleQuestion', 'getFinishNum']), |
|
|
|
|
|
|
|
changeVal(e, index, itemIndex) { |
|
|
|
const info = this.careInfo[index][itemIndex]; |
|
|
@ -214,16 +216,14 @@ export default { |
|
|
|
* 添加负担量表 |
|
|
|
* @param { Object } params |
|
|
|
*/ |
|
|
|
async submit(type) { |
|
|
|
async submit() { |
|
|
|
try { |
|
|
|
if (!this.validationRequired(this.params)) return; |
|
|
|
const params = this.params; |
|
|
|
params.projectId = this.projectId; |
|
|
|
const data = await this.$u.api.addZarit(params); |
|
|
|
if (data) { |
|
|
|
this.setReportId(data); |
|
|
|
this.setCode('ZARIT'); |
|
|
|
await this.startAssess(data, type); |
|
|
|
await this.handleFinishNum(data); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
@ -268,20 +268,46 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询已经完成的试题编号 |
|
|
|
* @param { string } code 题目code NLCP:脑力测评 ZARIT:照顾者负担量表 |
|
|
|
* @param { string } reportId 测评ID 脑力测评ID或zaritID |
|
|
|
*/ |
|
|
|
async handleFinishNum(id) { |
|
|
|
try { |
|
|
|
this.setReportId(id); |
|
|
|
this.setCode('ZARIT'); |
|
|
|
const params = { |
|
|
|
code: 'ZARIT', |
|
|
|
reportId: id, |
|
|
|
}; |
|
|
|
const data = await this.getFinishNum(params); |
|
|
|
this.startAssess(id, data); |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 开始填表 |
|
|
|
* @param { string } code 题目code NLCP:脑力测评 ZARIT:照顾者负担量表 |
|
|
|
* @param { number } num 题号 |
|
|
|
* @param { string } reportId 测评ID 脑力测评ID或zaritID |
|
|
|
*/ |
|
|
|
async startAssess(id, type) { |
|
|
|
console.log('type: ', type); |
|
|
|
async startAssess(id, data) { |
|
|
|
try { |
|
|
|
let num = 0; |
|
|
|
if (data.finishNum - 0 < data.totalNum - 0) { |
|
|
|
num = data.finishNum - 0 + 1; |
|
|
|
} else if (data.finishNum - 0 === data.totalNum - 0) { |
|
|
|
num = data.finishNum - 0; |
|
|
|
} else { |
|
|
|
num = 1; |
|
|
|
} |
|
|
|
const params = { |
|
|
|
code: 'ZARIT', |
|
|
|
reportId: id, |
|
|
|
num: num ? num - 0 + 1 : 1, |
|
|
|
num, |
|
|
|
}; |
|
|
|
await this.handleQuestion(params); |
|
|
|
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' }); |
|
|
|