|
@@ -121,7 +121,14 @@
|
|
|
:previewFullImage="true"
|
|
|
></up-upload>
|
|
|
</up-form-item>
|
|
|
- <up-button @click="submit" style="margin-top: 20rpx;">提交</up-button>
|
|
|
+ <up-button
|
|
|
+ :loading="state.loading"
|
|
|
+ loadingText="提交中"
|
|
|
+ :disabled="state.loading"
|
|
|
+ @click="submit"
|
|
|
+ style="margin-top: 20rpx;">
|
|
|
+ 提交
|
|
|
+ </up-button>
|
|
|
</up-form>
|
|
|
<up-action-sheet
|
|
|
:show="state.showOrderType"
|
|
@@ -158,14 +165,6 @@
|
|
|
@cancel="state.showEndClendar = false"
|
|
|
>
|
|
|
</up-datetime-picker>
|
|
|
- <up-upload
|
|
|
- @afterRead="afterRead"
|
|
|
- @delete="deletePic"
|
|
|
- name="imags"
|
|
|
- multiple
|
|
|
- :maxCount="5"
|
|
|
- :previewFullImage="true"
|
|
|
- ></up-upload>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -182,6 +181,7 @@ const state = reactive({
|
|
|
showOrderLevel: false,
|
|
|
showStartClendar: false,
|
|
|
showEndClendar: false,
|
|
|
+ loading: false,
|
|
|
model: {
|
|
|
order: {
|
|
|
files: [],
|
|
@@ -276,30 +276,30 @@ const afterRead = async (event) => {
|
|
|
}
|
|
|
}
|
|
|
const submit = () => {
|
|
|
+ state.loading = true
|
|
|
formRef.value.validate().then(async valid => {
|
|
|
- if (valid) {
|
|
|
- const order = state.model.order
|
|
|
- submitOrderWork({
|
|
|
- "name": order.name,
|
|
|
- "type": order.type,
|
|
|
- "level": order.level,
|
|
|
- "estimatedStartTime": dayjs(order.startDate).format(DateFormat.YYYYMMDDHHMMSS),
|
|
|
- "estimatedEndTime": dayjs(order.endDate).format(DateFormat.YYYYMMDDHHMMSS),
|
|
|
- "description": order.desc,
|
|
|
- "source": 2,
|
|
|
- "problemImg": JSON.stringify(order.files),
|
|
|
- "problemFile": null
|
|
|
- }).then(res => {
|
|
|
- uni.$u.toast('提交成功')
|
|
|
- reloadPage()
|
|
|
- })
|
|
|
- } else {
|
|
|
- uni.$u.toast('校验失败')
|
|
|
- }
|
|
|
+ const order = state.model.order
|
|
|
+ submitOrderWork({
|
|
|
+ "name": order.name,
|
|
|
+ "type": order.type,
|
|
|
+ "level": order.level,
|
|
|
+ "estimatedStartTime": dayjs(order.startDate).format(DateFormat.YYYYMMDDHHMMSS),
|
|
|
+ "estimatedEndTime": dayjs(order.endDate).format(DateFormat.YYYYMMDDHHMMSS),
|
|
|
+ "description": order.desc,
|
|
|
+ "source": 2,
|
|
|
+ "problemImg": JSON.stringify(order.files),
|
|
|
+ "problemFile": null
|
|
|
+ }).then(res => {
|
|
|
+ uni.$u.toast('提交成功')
|
|
|
+ reloadPage()
|
|
|
+ }).finally(() => {
|
|
|
+ state.loading = false
|
|
|
+ })
|
|
|
}).catch((e) => {
|
|
|
// 处理验证错误
|
|
|
uni.$u.toast('校验失败')
|
|
|
- });
|
|
|
+ state.loading = false
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|