|
@@ -129,9 +129,19 @@
|
|
|
components: {
|
|
|
SpotcheckContentModal
|
|
|
},
|
|
|
+ props: {
|
|
|
+ selectData: {
|
|
|
+ type: Object,
|
|
|
+ default: function(){
|
|
|
+ return {} // 使用工厂函数返回默认值
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
data () {
|
|
|
return {
|
|
|
description: '点检内容管理页面',
|
|
|
+ // 查询参数
|
|
|
+ queryParam: {},
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{
|
|
@@ -204,6 +214,41 @@
|
|
|
methods: {
|
|
|
initDictConfig(){
|
|
|
},
|
|
|
+ loadData(arg) {
|
|
|
+ if(!this.url.list){
|
|
|
+ this.$message.error("请设置url.list属性!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //加载数据 若传入参数1则加载第一页的内容
|
|
|
+ if (arg === 1) {
|
|
|
+ this.ipagination.current = 1;
|
|
|
+ }
|
|
|
+ var params = this.getQueryParams();//查询条件
|
|
|
+ this.loading = true;
|
|
|
+ getAction(this.url.list, params).then((res) => {
|
|
|
+ if (res.success) {
|
|
|
+ //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
+ this.dataSource = res.result.records||res.result;
|
|
|
+ if(res.result.total)
|
|
|
+ {
|
|
|
+ this.ipagination.total = res.result.total;
|
|
|
+ }else{
|
|
|
+ this.ipagination.total = 0;
|
|
|
+ }
|
|
|
+ //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
+ }else{
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 处理父组件传过来的数据
|
|
|
+ getDataList(){
|
|
|
+ // console.log(111,this.selectData)
|
|
|
+ this.queryParam.equipmentid = this.selectData.id
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
modalFormOk() {
|
|
|
// 新增/修改 成功时,重载列表
|
|
|
this.loadData();
|