|
@@ -175,6 +175,15 @@
|
|
|
getAction(this.url.queryById, record).then((res) => {
|
|
|
console.log(88,res)
|
|
|
this.model = res.result
|
|
|
+ this.model.spotcheckContentItemList = this.model.spotcheckContentItemList.map((res) => {
|
|
|
+ return {
|
|
|
+ id: res.spotcheckitemid,
|
|
|
+ itemcode: res.itemcode,
|
|
|
+ itemname: res.itemname,
|
|
|
+ conditions: res.conditions,
|
|
|
+ remark: res.remark
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
// this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
@@ -191,21 +200,31 @@
|
|
|
httpurl+=this.url.add;
|
|
|
method = 'post';
|
|
|
this.model.status = 1
|
|
|
+ this.model.spotcheckContentItemList = this.model.spotcheckContentItemList.map((res) => {
|
|
|
+ return {
|
|
|
+ spotcheckitemid: res.id
|
|
|
+ }
|
|
|
+ })
|
|
|
}else{
|
|
|
httpurl+=this.url.edit;
|
|
|
method = 'put';
|
|
|
+ this.model.spotcheckContentItemList = this.model.spotcheckContentItemList.map((res) => {
|
|
|
+ return {
|
|
|
+ spotcheckitemid: res.id
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
console.log(99,this.model)
|
|
|
- // httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
- // if(res.success){
|
|
|
- // that.$message.success(res.message);
|
|
|
- // that.$emit('ok');
|
|
|
- // }else{
|
|
|
- // that.$message.warning(res.message);
|
|
|
- // }
|
|
|
- // }).finally(() => {
|
|
|
- // that.confirmLoading = false;
|
|
|
- // })
|
|
|
+ httpAction(httpurl,this.model,method).then((res)=>{
|
|
|
+ if(res.success){
|
|
|
+ that.$message.success(res.message);
|
|
|
+ that.$emit('ok');
|
|
|
+ }else{
|
|
|
+ that.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ that.confirmLoading = false;
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
})
|