|
@@ -50,12 +50,12 @@
|
|
|
bordered
|
|
|
rowKey="id"
|
|
|
:columns="columns"
|
|
|
- :dataSource="dataSource"
|
|
|
+ :dataSource="model.spotcheckContentItemList"
|
|
|
:pagination="false"
|
|
|
:loading="loading"
|
|
|
class="j-table-force-nowrap">
|
|
|
</a-table>
|
|
|
- <cmms-spotcheck-content-modal-add ref="modalForm" @ok="modalFormOk" :modelForm="model" :dataList="dataSource" @customEvent="handleCustomEvent"></cmms-spotcheck-content-modal-add>
|
|
|
+ <cmms-spotcheck-content-modal-add ref="modalForm" @ok="modalFormOk" :modelForm="model" :dataList="model.spotcheckContentItemList" @customEvent="handleCustomEvent"></cmms-spotcheck-content-modal-add>
|
|
|
</a-form-model>
|
|
|
</j-form-container>
|
|
|
</a-spin>
|
|
@@ -88,6 +88,7 @@ import CmmsSpotcheckContentModalAdd from './CmmsSpotcheckContentModalAdd.vue'
|
|
|
data () {
|
|
|
return {
|
|
|
model:{
|
|
|
+ spotcheckContentItemList: []
|
|
|
},
|
|
|
labelCol: {
|
|
|
xs: { span: 24 },
|
|
@@ -143,13 +144,14 @@ import CmmsSpotcheckContentModalAdd from './CmmsSpotcheckContentModalAdd.vue'
|
|
|
dataIndex: 'remark'
|
|
|
}
|
|
|
],
|
|
|
- dataSource: [],
|
|
|
+ // dataSource: [],
|
|
|
loading:false,
|
|
|
url: {
|
|
|
list: "/cmmsSpotcheckItem/cmmsSpotcheckItem/listbyequipmentid/{equipmentid}",
|
|
|
add: "/cmmsSpotcheckContent/cmmsSpotcheckContent/add",
|
|
|
edit: "/cmmsSpotcheckContent/cmmsSpotcheckContent/edit",
|
|
|
- queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryById"
|
|
|
+ // queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryById"
|
|
|
+ queryById: "/cmmsSpotcheckContent/cmmsSpotcheckContent/queryContentAndItemById"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -164,10 +166,16 @@ import CmmsSpotcheckContentModalAdd from './CmmsSpotcheckContentModalAdd.vue'
|
|
|
},
|
|
|
methods: {
|
|
|
add () {
|
|
|
- this.edit(this.modelDefault);
|
|
|
+ // this.edit(this.modelDefault);
|
|
|
+ this.model = Object.assign({}, this.modelDefault);
|
|
|
+ this.visible = true;
|
|
|
},
|
|
|
edit (record) {
|
|
|
- this.model = Object.assign({}, record);
|
|
|
+ getAction(this.url.queryById, record).then((res) => {
|
|
|
+ console.log(88,res)
|
|
|
+ this.model = res.result
|
|
|
+ })
|
|
|
+ // this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
},
|
|
|
submitForm () {
|
|
@@ -181,20 +189,22 @@ import CmmsSpotcheckContentModalAdd from './CmmsSpotcheckContentModalAdd.vue'
|
|
|
if(!this.model.id){
|
|
|
httpurl+=this.url.add;
|
|
|
method = 'post';
|
|
|
+ this.model.status = 1
|
|
|
}else{
|
|
|
httpurl+=this.url.edit;
|
|
|
- method = 'put';
|
|
|
+ method = 'put';
|
|
|
}
|
|
|
- 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;
|
|
|
- })
|
|
|
+ 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;
|
|
|
+ // })
|
|
|
}
|
|
|
|
|
|
})
|
|
@@ -213,7 +223,7 @@ import CmmsSpotcheckContentModalAdd from './CmmsSpotcheckContentModalAdd.vue'
|
|
|
handleCustomEvent(data) {
|
|
|
// 处理从子组件传递过来的数据
|
|
|
console.log("Received Data:", data);
|
|
|
- this.dataSource = data;
|
|
|
+ this.model.spotcheckContentItemList = data;
|
|
|
}
|
|
|
}
|
|
|
}
|