|
|
@@ -279,14 +279,22 @@
|
|
|
</el-form>
|
|
|
|
|
|
<div slot="footer" class="footer">
|
|
|
- <el-button type="primary" @click="submitAdd" v-if="type != 'view'">{{
|
|
|
- type == 'edit' ? '保存' : '报工'
|
|
|
- }}</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="submitAdd"
|
|
|
+ v-if="type != 'view'"
|
|
|
+ >{{ type == 'edit' ? '保存' : '报工' }}</el-button
|
|
|
+ >
|
|
|
|
|
|
- <el-button type="primary" @click="saveAdd" v-if="type == 'report'"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ @click="saveAdd"
|
|
|
+ v-if="type == 'report'"
|
|
|
>保存</el-button
|
|
|
>
|
|
|
- <el-button @click="handleClose">取消</el-button>
|
|
|
+ <el-button @click="handleClose" :loading="loading">取消</el-button>
|
|
|
</div>
|
|
|
</ele-modal>
|
|
|
</template>
|
|
|
@@ -363,7 +371,8 @@
|
|
|
dispatchUserName: '',
|
|
|
dispatchTime: ''
|
|
|
},
|
|
|
- detailList: []
|
|
|
+ detailList: [],
|
|
|
+ loading: false
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
@@ -546,12 +555,18 @@
|
|
|
// let api = this.type == 'edit' ? updateScheme : reportWorkingSalesWorkOrder;
|
|
|
let api =
|
|
|
type == 'edit' ? updateScheme : reportWorkingSalesWorkOrder;
|
|
|
- await api(data).then((res) => {
|
|
|
- if (!res) return;
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.visibleDialog = false;
|
|
|
- this.$emit('reload');
|
|
|
- });
|
|
|
+ this.loading = true;
|
|
|
+ await api(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.visibleDialog = false;
|
|
|
+ this.$emit('reload');
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -597,12 +612,18 @@
|
|
|
};
|
|
|
data.accessoryApply = accessoryApply;
|
|
|
}
|
|
|
- await updateScheme(data).then((res) => {
|
|
|
- if (!res) return;
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.visibleDialog = false;
|
|
|
- this.$emit('reload');
|
|
|
- });
|
|
|
+ this.loading = true;
|
|
|
+ await updateScheme(data)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.visibleDialog = false;
|
|
|
+ this.$emit('reload');
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|