|
|
|
@ -86,8 +86,13 @@ |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
<view class="p-4"> |
|
|
|
<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 type="primary" @click="submit" v-if="!disabled" :loading="loading">保存并开始填表</u-button> |
|
|
|
<u-button |
|
|
|
type="primary" |
|
|
|
@click="handleFinishNum(detail.id)" |
|
|
|
v-if="disabled && detail.zaritPoint === null && detail.selfFill === 1" |
|
|
|
:loading="loading" |
|
|
|
> |
|
|
|
继续填表 |
|
|
|
</u-button> |
|
|
|
</view> |
|
|
|
@ -114,6 +119,7 @@ export default { |
|
|
|
careInfo, |
|
|
|
show: true, |
|
|
|
params: {}, |
|
|
|
loading: false, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -218,14 +224,17 @@ export default { |
|
|
|
*/ |
|
|
|
async submit() { |
|
|
|
try { |
|
|
|
this.loading = true; |
|
|
|
if (!this.validationRequired(this.params)) return; |
|
|
|
const params = this.params; |
|
|
|
params.projectId = this.projectId; |
|
|
|
const data = await this.$u.api.addZarit(params); |
|
|
|
this.loading = false; |
|
|
|
if (data) { |
|
|
|
await this.handleFinishNum(data); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.loading = false; |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -277,6 +286,7 @@ export default { |
|
|
|
*/ |
|
|
|
async handleFinishNum(id) { |
|
|
|
try { |
|
|
|
this.loading = true; |
|
|
|
this.setReportId(id); |
|
|
|
this.setCode('ZARIT'); |
|
|
|
const params = { |
|
|
|
@ -284,8 +294,10 @@ export default { |
|
|
|
reportId: id, |
|
|
|
}; |
|
|
|
const data = await this.getFinishNum(params); |
|
|
|
this.startAssess(id, data); |
|
|
|
this.loading = false; |
|
|
|
await this.startAssess(id, data); |
|
|
|
} catch (error) { |
|
|
|
this.loading = false; |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -298,6 +310,7 @@ export default { |
|
|
|
*/ |
|
|
|
async startAssess(id, data) { |
|
|
|
try { |
|
|
|
this.loading = true; |
|
|
|
let num = 0; |
|
|
|
if (data.finishNum - 0 < data.totalNum - 0) { |
|
|
|
num = data.finishNum - 0 + 1; |
|
|
|
@ -312,8 +325,10 @@ export default { |
|
|
|
num, |
|
|
|
}; |
|
|
|
await this.handleQuestion(params); |
|
|
|
this.loading = false; |
|
|
|
uni.navigateTo({ url: '/pagesYanyuan/assess/assess' }); |
|
|
|
} catch (error) { |
|
|
|
this.loading = false; |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
|
}, |
|
|
|
|