|
|
@@ -405,39 +405,41 @@
|
|
|
}
|
|
|
},
|
|
|
addInfoChangeCom() {
|
|
|
- this.$confirm("确定添加变更申请, 是否继续?", "提示", {
|
|
|
+ if (this.entityForm.SupplierId > 0) {
|
|
|
+ this.$confirm("确定添加变更申请, 是否继续?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- api.addInfoChMain(this.entityForm, this.$axios).then(res => {
|
|
|
- if (res.data.code === 0) {
|
|
|
- //保存成功后,初始化数据,变成修改
|
|
|
- this.entityForm.Id = res.data.item;
|
|
|
- this.$router.push({
|
|
|
- path: '/oilsupplier/infochangech/' + this.entityForm.SupplierId + '/operation',
|
|
|
- query: {
|
|
|
- InfoStatus: 0,
|
|
|
- infoId: this.entityForm.Id,
|
|
|
- }
|
|
|
- })
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
+ .then(() => {
|
|
|
+ api.addInfoChMain(this.entityForm, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ //保存成功后,初始化数据,变成修改
|
|
|
+ this.entityForm.Id = res.data.item;
|
|
|
+ this.$router.push({
|
|
|
+ path: '/oilsupplier/infochangech/' + this.entityForm.SupplierId + '/operation',
|
|
|
+ query: {
|
|
|
+ InfoStatus: 0,
|
|
|
+ infoId: this.entityForm.Id,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- });
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- console.error(err)
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
},
|
|
|
addInfoChange() {
|
|
|
this.$refs['EntityFormref'].validate((valid) => {
|