update 一些视图,并且优化dialog
This commit is contained in:
parent
cd9beb120a
commit
0ef30e1985
@ -150,9 +150,10 @@ export default {
|
||||
visible: false,
|
||||
isEdit: false,
|
||||
isDetail: false,
|
||||
isUpdated: false,
|
||||
dataForm: {},
|
||||
dataFormRules: {}
|
||||
dataFormRules: {},
|
||||
tempForm: [], // 临时保存自动生成的code,或其他数据
|
||||
shouldWait: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -162,6 +163,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('mounted>..')
|
||||
/** 计算 defaultPlaceholders */
|
||||
const prefix = '请输入'
|
||||
Object.entries(this.defaultNames).map(([key, value]) => {
|
||||
@ -182,12 +184,14 @@ export default {
|
||||
this.$set(this.dataForm, [item.name], '')
|
||||
if (item.api) {
|
||||
/** 自动请求并填充 */
|
||||
this.$http({
|
||||
// or this.shouldWaitPool = []
|
||||
this.shouldWait = this.$http({
|
||||
url: this.$http.adornUrl(item.api),
|
||||
method: 'POST' // 也可以改成动态决定
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
this.dataForm[item.name] = res.data // <=== 此处需要对接口
|
||||
// this.dataForm[item.name] = res.data // <=== 此处需要对接口
|
||||
this.tempForm.push({ name: item.name, data: res.data })
|
||||
}
|
||||
})
|
||||
} // end if (item.api)
|
||||
@ -236,9 +240,6 @@ export default {
|
||||
this.$set(this.dataForm, 'id', null)
|
||||
})
|
||||
},
|
||||
updated() {
|
||||
this.isUpdated = true // 此时如果点击保存就会 emit(refreshDataList)
|
||||
},
|
||||
|
||||
methods: {
|
||||
getLabel(n, c) {
|
||||
@ -286,6 +287,16 @@ export default {
|
||||
this.dataForm = pick(res.data, dataFormKeys)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
/** 如果不是编辑,就填充自动生成的数据 */
|
||||
if (this.shouldWait)
|
||||
this.shouldWait.then(() => {
|
||||
if (this.tempForm.length) {
|
||||
this.tempForm.forEach(item => {
|
||||
this.dataForm[item.name] = item.data
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -351,7 +362,7 @@ export default {
|
||||
},
|
||||
|
||||
handleClose() {
|
||||
if (this.isAdd || this.isUpdated) this.$emit('refreshDataList')
|
||||
this.$emit('destory-dialog')
|
||||
this.visible = false
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:equipmengroup:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
|
||||
<el-button v-if="$hasPermission('monitoring:equipmentgroup:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
@ -33,7 +32,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -45,12 +44,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmentGroup-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './equipmentGroup-add-or-update'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -61,22 +61,15 @@ const tableConfigs = [
|
||||
{ prop: 'code', name: '分组编码' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
{ prop: 'alarm', name: '报警', buttonContent: '查看报警', subcomponent: TableTextComponent },
|
||||
// { "prop": "typeId", "name": "设备类型id" },
|
||||
// { "prop": "id", "name": "ID" },
|
||||
// { "prop": "description", "name": "描述" },
|
||||
// { "prop": "valid", "name": "删除标志,是否有效:1 可用 0不可用" },
|
||||
// { "prop": "creatorId", "name": "创建人" },
|
||||
// { "prop": "creatorName", "name": "创建人姓名" },
|
||||
// { "prop": "updaterId", "name": "更新人" },
|
||||
// { "prop": "updaterName", "name": "更新人姓名" },
|
||||
// { "prop": "updateTime", "name": "更新时间" },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -100,6 +93,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentGroup/page'),
|
||||
@ -135,6 +129,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
@ -7,7 +7,6 @@
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:equipmenttype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
@ -35,7 +34,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -47,12 +46,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipmentType-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './equipmentType-add-or-update'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -62,24 +62,15 @@ const tableConfigs = [
|
||||
{ prop: 'name', name: '类型名称' },
|
||||
{ prop: 'code', name: '类型编码' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
// { "prop": "id", "name": "ID" },
|
||||
// { "prop": "parentId", "name": "父类ID" },
|
||||
// { "prop": "parentName", "name": "父类名称" },
|
||||
// { "prop": "description", "name": "描述" },
|
||||
// { "prop": "enabled", "name": "启用状态:0 、停用,1、启用" },
|
||||
// { "prop": "valid", "name": "删除标志,是否有效:1 可用 0不可用" },
|
||||
// { "prop": "creatorId", "name": "创建人" },
|
||||
// { "prop": "creatorName", "name": "创建人姓名" },
|
||||
// { "prop": "updaterId", "name": "更新人" },
|
||||
// { "prop": "updaterName", "name": "更新人姓名" },
|
||||
// { "prop": "updateTime", "name": "更新时间" },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -103,6 +94,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipmentType/page'),
|
||||
@ -138,6 +130,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
@ -7,7 +7,6 @@
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:factory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
@ -35,7 +34,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -47,12 +46,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './factory-add-or-update'
|
||||
// import AddOrUpdate from './factory-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -63,23 +63,37 @@ const tableConfigs = [
|
||||
{ prop: 'code', name: '工厂编码' },
|
||||
{ prop: 'address', name: '地址' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
// { prop: 'id', name: 'id' },
|
||||
// { prop: 'description', name: '描述' },
|
||||
// { prop: 'enabled', name: '启用状态:0 、停用,1、启用' },
|
||||
// { prop: 'valid', name: '删除标志,是否有效:1 可用 0不可用' },
|
||||
// { prop: 'creatorId', name: '创建人' },
|
||||
// { prop: 'creatorName', name: '创建人姓名' },
|
||||
// { prop: 'updaterId', name: '更新人' },
|
||||
// { prop: 'updaterName', name: '更新人姓名' },
|
||||
// { prop: 'updateTime', name: '更新时间' },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
// { prop: 'externalCode', name: '外部系统编码' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {
|
||||
type: 'dialog',
|
||||
infoUrl: '/monitoring/factory',
|
||||
fields: [
|
||||
'name',
|
||||
{
|
||||
name: 'code',
|
||||
api: '/monitoring/factory/getCode'
|
||||
},
|
||||
{
|
||||
name: 'address',
|
||||
label: '地址',
|
||||
placeholder: '请输入地址'
|
||||
},
|
||||
'remark'
|
||||
],
|
||||
operations: [
|
||||
{ name: 'reset', url: true, showAlways: true },
|
||||
{ name: 'cancel', url: true, showAlways: true },
|
||||
{ name: 'save', url: '/monitoring/factory', permission: '', showOnEdit: false },
|
||||
{ name: 'update', url: '/monitoring/factory', permission: '', showOnEdit: true }
|
||||
]
|
||||
}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -103,6 +117,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/factory/page'),
|
||||
@ -138,6 +153,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
@ -55,7 +55,7 @@
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> -->
|
||||
|
||||
<base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs" @refreshDataList="getDataList"></base-dialog>
|
||||
<base-dialog v-if="showbasedialog" ref="basedialog" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="showbasedialog = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:producarrt:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:productarrt:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -48,7 +48,7 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" :configs="addOrUpdateConfigs" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" :configs="addOrUpdateConfigs" ref="addOrUpdate" @refreshDataList="getDataList" @destroy-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList"/>
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -48,7 +48,7 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -88,9 +88,7 @@ const addOrUpdateConfigs = {
|
||||
placeholder: '请输入合理数值',
|
||||
type: 'number', // TODO: 可改进为自动应用 number 验证,此时还必须添加下述规则:
|
||||
required: true,
|
||||
rules: [
|
||||
{type: 'number', transform: val => Number(val), trigger: 'blur', message: '请输入数字类型'}
|
||||
]
|
||||
rules: [{ type: 'number', transform: val => Number(val), trigger: 'blur', message: '请输入数字类型' }]
|
||||
},
|
||||
'description',
|
||||
'remark'
|
||||
@ -139,7 +137,7 @@ export default {
|
||||
}
|
||||
this.addOrUpdateConfigs.fields.forEach(item => {
|
||||
if (item.name === 'factoryId') {
|
||||
console.log('res' ,item)
|
||||
console.log('res', item)
|
||||
item.options = this.factoryList.map(f => ({ value: f.id, label: f.name }))
|
||||
}
|
||||
})
|
||||
@ -147,6 +145,7 @@ export default {
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/productionLine/page'),
|
||||
@ -182,7 +181,7 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({type, data: id}) {
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
|
@ -31,7 +31,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -43,12 +43,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './qualityInspectionDet-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './qualityInspectionDet-add-or-update'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -59,20 +60,15 @@ const tableConfigs = [
|
||||
{ prop: 'content', name: '检测内容' },
|
||||
{ prop: 'code', name: '检测编码' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
// { prop: 'id', name: 'ID' },
|
||||
// { prop: 'valid', name: '删除标志,是否有效:1 可用 0不可用' },
|
||||
// { prop: 'creatorId', name: '创建人' },
|
||||
// { prop: 'creatorName', name: '创建人姓名' },
|
||||
// { prop: 'updaterId', name: '更新人' },
|
||||
// { prop: 'updaterName', name: '更新人姓名' },
|
||||
// { prop: 'updateTime', name: '更新时间' },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -96,6 +92,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityInspectionDet/page'),
|
||||
@ -131,6 +128,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
@ -36,7 +36,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -48,12 +48,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './qualityInspectionRecord-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './qualityInspectionRecord-add-or-update'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -74,21 +75,15 @@ const tableConfigs = [
|
||||
// { prop: 'source', name: '来源 1,手动(默认) 2,自动' },
|
||||
{ prop: 'explainText', name: '描述' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
// { prop: 'inspectionDetId', name: '检测内容id' },
|
||||
// { prop: 'id', name: 'ID' },
|
||||
// { prop: 'valid', name: '删除标志,是否有效:1 可用 0不可用' },
|
||||
// { prop: 'creatorId', name: '创建人' },
|
||||
// { prop: 'creatorName', name: '创建人姓名' },
|
||||
// { prop: 'updaterId', name: '更新人' },
|
||||
// { prop: 'updaterName', name: '更新人姓名' },
|
||||
// { prop: 'updateTime', name: '更新时间' },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -112,6 +107,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityInspectionRecord/page'),
|
||||
@ -147,6 +143,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
@ -30,7 +30,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -42,12 +42,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './qualityInspectionType-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './qualityInspectionType-add-or-update'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -57,20 +58,15 @@ const tableConfigs = [
|
||||
{ prop: 'name', name: '检测类型名称' },
|
||||
{ prop: 'code', name: '检测类型编码' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
// { prop: 'id', name: 'ID' },
|
||||
// { prop: 'valid', name: '删除标志,是否有效:1 可用 0不可用' },
|
||||
// { prop: 'creatorId', name: '创建人' },
|
||||
// { prop: 'creatorName', name: '创建人姓名' },
|
||||
// { prop: 'updaterId', name: '更新人' },
|
||||
// { prop: 'updaterName', name: '更新人姓名' },
|
||||
// { prop: 'updateTime', name: '更新时间' },
|
||||
// { prop: 'version', name: '版本号' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -94,6 +90,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/qualityInspectionType/page'),
|
||||
@ -129,6 +126,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
@ -7,7 +7,6 @@
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="$hasPermission('monitoring:workshopsection:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
@ -36,7 +35,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table> -->
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" />
|
||||
<base-table :data="dataList" :table-head-configs="tableConfigs" :max-height="500" @operate-event="handleOperations" @refreshDataList="getDataList" />
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
@ -48,12 +47,13 @@
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :configs="addOrUpdateConfigs" @refreshDataList="getDataList" @destory-dialog="addOrUpdateVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './workshopSection-add-or-update'
|
||||
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||
// import AddOrUpdate from './workshopSection-add-or-update'
|
||||
import BaseTable from '@/components/base-table'
|
||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||
@ -64,24 +64,15 @@ const tableConfigs = [
|
||||
{ prop: 'code', name: '工段编码' },
|
||||
{ prop: 'productionLineId', name: '产线ID' },
|
||||
{ prop: 'remark', name: '备注' },
|
||||
// { "prop": "id", "name": "id" },
|
||||
// { "prop": "description", "name": "描述" },
|
||||
// { "prop": "enabled", "name": "启用状态:0 、停用,1、启用" },
|
||||
// { "prop": "sort", "name": "排序" },
|
||||
// { "prop": "valid", "name": "删除标志,是否有效:1 可用 0不可用" },
|
||||
// { "prop": "creatorId", "name": "创建人" },
|
||||
// { "prop": "creatorName", "name": "创建人姓名" },
|
||||
// { "prop": "updaterId", "name": "更新人" },
|
||||
// { "prop": "updaterName", "name": "更新人姓名" },
|
||||
// { "prop": "updateTime", "name": "更新时间" },
|
||||
// { "prop": "version", "name": "版本号" },
|
||||
// { prop: 'externalCode', name: '外部系统编码' },
|
||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||
]
|
||||
|
||||
const addOrUpdateConfigs = {}
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateConfigs,
|
||||
tableConfigs,
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -105,6 +96,7 @@ export default {
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.addOrUpdateVisible = false
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/workshopSection/page'),
|
||||
@ -140,6 +132,14 @@ export default {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
handleOperations({ type, data: id }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
return this.addOrUpdateHandle(id)
|
||||
case 'delete':
|
||||
return this.deleteHandle(id)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
|
Loading…
Reference in New Issue
Block a user