|
@@ -15,16 +15,28 @@
|
|
|
<SubmitDialog ref="submitRef" @savExit="savExit" />
|
|
<SubmitDialog ref="submitRef" @savExit="savExit" />
|
|
|
<dispatchDialog ref="dispatchRef" @savExit="savExit" />
|
|
<dispatchDialog ref="dispatchRef" @savExit="savExit" />
|
|
|
<div slot="footer" class="footer">
|
|
<div slot="footer" class="footer">
|
|
|
- <el-button type="primary" @click="submitAdd" v-if="type != 'view'"
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ @click="submitAdd"
|
|
|
|
|
+ v-if="type != 'view'"
|
|
|
>保存</el-button
|
|
>保存</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button type="primary" @click="submit" v-if="type != 'view'"
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ @click="submit"
|
|
|
|
|
+ v-if="type != 'view'"
|
|
|
>提交</el-button
|
|
>提交</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button type="primary" @click="dispatch" v-if="type != 'view'"
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ @click="dispatch"
|
|
|
|
|
+ v-if="type != 'view'"
|
|
|
>派单</el-button
|
|
>派单</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button @click="handleClose">返回</el-button>
|
|
|
|
|
|
|
+ <el-button @click="handleClose" :loading="loading">返回</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
|
</template>
|
|
</template>
|
|
@@ -63,7 +75,8 @@
|
|
|
addRepairNotesDialog: false,
|
|
addRepairNotesDialog: false,
|
|
|
type: 'add',
|
|
type: 'add',
|
|
|
form: {},
|
|
form: {},
|
|
|
- demandList: []
|
|
|
|
|
|
|
+ demandList: [],
|
|
|
|
|
+ loading: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -176,10 +189,10 @@
|
|
|
return item;
|
|
return item;
|
|
|
}),
|
|
}),
|
|
|
contactInfoVOS: data.contactInfoVOS,
|
|
contactInfoVOS: data.contactInfoVOS,
|
|
|
- associationType:data.associationType
|
|
|
|
|
|
|
+ associationType: data.associationType
|
|
|
};
|
|
};
|
|
|
// 如果选的销售订单并且 没有售后对象数据
|
|
// 如果选的销售订单并且 没有售后对象数据
|
|
|
- if(pData.associationType == '2' && pData.productDetail.length == 0){
|
|
|
|
|
|
|
+ if (pData.associationType == '2' && pData.productDetail.length == 0) {
|
|
|
delete pData.productDetail;
|
|
delete pData.productDetail;
|
|
|
pData.faultDetailList = data.faultDetailList;
|
|
pData.faultDetailList = data.faultDetailList;
|
|
|
}
|
|
}
|
|
@@ -197,15 +210,19 @@
|
|
|
if (!pData) {
|
|
if (!pData) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ this.loading = true;
|
|
|
let requestname =
|
|
let requestname =
|
|
|
this.title === '新增' ? saveSalesDemand : updateSalesDemand;
|
|
this.title === '新增' ? saveSalesDemand : updateSalesDemand;
|
|
|
const res = await requestname(pData);
|
|
const res = await requestname(pData);
|
|
|
|
|
+ this.loading = false;
|
|
|
if (res) {
|
|
if (res) {
|
|
|
this.$message.success('操作成功!');
|
|
this.$message.success('操作成功!');
|
|
|
this.$emit('refresh');
|
|
this.$emit('refresh');
|
|
|
this.handleClose();
|
|
this.handleClose();
|
|
|
}
|
|
}
|
|
|
- } catch (error) {}
|
|
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|