update
This commit is contained in:
parent
0ddba21e1c
commit
a1056abe80
@ -122,6 +122,7 @@ export default {
|
|||||||
name: '名称',
|
name: '名称',
|
||||||
code: '编码',
|
code: '编码',
|
||||||
remark: '备注',
|
remark: '备注',
|
||||||
|
description: '描述',
|
||||||
specifications: '规格'
|
specifications: '规格'
|
||||||
// add more...
|
// add more...
|
||||||
}
|
}
|
||||||
@ -140,6 +141,7 @@ export default {
|
|||||||
name: '名称',
|
name: '名称',
|
||||||
code: '编码',
|
code: '编码',
|
||||||
remark: '备注',
|
remark: '备注',
|
||||||
|
description: '描述',
|
||||||
specifications: '规格'
|
specifications: '规格'
|
||||||
// add more...
|
// add more...
|
||||||
},
|
},
|
||||||
@ -317,6 +319,12 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}).catch(err => {
|
||||||
|
this.$message({
|
||||||
|
message: err,
|
||||||
|
type: 'error',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -55,6 +55,8 @@ http.interceptors.response.use(response => {
|
|||||||
clearLoginInfo()
|
clearLoginInfo()
|
||||||
router.replace({ name: 'login' })
|
router.replace({ name: 'login' })
|
||||||
return Promise.reject(response.data.msg)
|
return Promise.reject(response.data.msg)
|
||||||
|
} else if (response.data.code === 500) {
|
||||||
|
return Promise.reject(response.data.msg)
|
||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
}, error => {
|
}, error => {
|
||||||
|
@ -137,7 +137,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipment'),
|
url: this.$http.adornUrl('/monitoring/equipment'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -153,7 +153,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentAlarmLog'),
|
url: this.$http.adornUrl('/monitoring/equipmentAlarmLog'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -162,7 +162,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentFile'),
|
url: this.$http.adornUrl('/monitoring/equipmentFile'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -157,7 +157,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentGroup'),
|
url: this.$http.adornUrl('/monitoring/equipmentGroup'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -175,7 +175,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentGroupAlarm'),
|
url: this.$http.adornUrl('/monitoring/equipmentGroupAlarm'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -171,7 +171,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentPlc'),
|
url: this.$http.adornUrl('/monitoring/equipmentPlc'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -151,7 +151,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentPlcConnect'),
|
url: this.$http.adornUrl('/monitoring/equipmentPlcConnect'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -183,7 +183,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentPlcParam'),
|
url: this.$http.adornUrl('/monitoring/equipmentPlcParam'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -165,7 +165,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentQuantity'),
|
url: this.$http.adornUrl('/monitoring/equipmentQuantity'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -159,7 +159,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentStatusLog'),
|
url: this.$http.adornUrl('/monitoring/equipmentStatusLog'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="getDataList()">查询</el-button>
|
<el-button @click="getDataList()">查询</el-button>
|
||||||
<el-button v-if="$hasPermission('monitoring:equipmentype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button v-if="$hasPermission('monitoring:equipmenttype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -160,7 +160,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentType'),
|
url: this.$http.adornUrl('/monitoring/equipmentType'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -160,7 +160,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentTypeFile'),
|
url: this.$http.adornUrl('/monitoring/equipmentTypeFile'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -154,7 +154,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/equipmentAttr'),
|
url: this.$http.adornUrl('/monitoring/equipmentAttr'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -160,7 +160,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/factory'),
|
url: this.$http.adornUrl('/monitoring/factory'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -6,8 +6,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="getDataList()">查询</el-button>
|
<el-button @click="getDataList()">查询</el-button>
|
||||||
<el-button @click="addOrEdit()">测试</el-button>
|
<!-- <el-button @click="addOrEdit()">测试</el-button> -->
|
||||||
<el-button v-if="$hasPermission('monitoring:product:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<!-- <el-button v-if="$hasPermission('monitoring:product:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> -->
|
||||||
|
<el-button v-if="$hasPermission('monitoring:product:save')" type="primary" @click="addOrEdit()">新增</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||||
@ -52,17 +53,17 @@
|
|||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
></el-pagination>
|
></el-pagination>
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
<!-- <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"></base-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './product-add-or-update'
|
// import AddOrUpdate from './product-add-or-update'
|
||||||
import BaseTable from '@/components/base-table'
|
import BaseTable from '@/components/base-table'
|
||||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||||
import BaseDialog from '@/components/base-dialog/addOrUpdate'
|
import BaseDialog from '@/components/base-dialog/addOrUpdate'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import dictListMixin from '@/mixins/dictlist-module'
|
import dictListMixin from '@/mixins/dictlist-module'
|
||||||
@ -77,27 +78,7 @@ const tableConfigs = [
|
|||||||
{ prop: 'code', name: '产品编码' },
|
{ prop: 'code', name: '产品编码' },
|
||||||
{ prop: 'specifications', name: '规格' },
|
{ prop: 'specifications', name: '规格' },
|
||||||
{ prop: 'unitDictValue', name: '单位', filter: dictFilter(UnitDictTypeId) },
|
{ prop: 'unitDictValue', name: '单位', filter: dictFilter(UnitDictTypeId) },
|
||||||
// { prop: 'unitDictValue', name: '单位value,对应到数据字典label_value' },
|
|
||||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['viewAttr', 'delete'] }
|
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['viewAttr', 'delete'] }
|
||||||
|
|
||||||
// { "prop": "id", "name": "ID" },
|
|
||||||
// { "prop": "description", "name": "描述" },
|
|
||||||
// { "prop": "externalCode", "name": "外部编码,用于对照外部系统的编码" },
|
|
||||||
// { "prop": "area", "name": "一单位的面积(平方米)" },
|
|
||||||
// { "prop": "processTime", "name": "加工一单位产品需要的时间" },
|
|
||||||
// {
|
|
||||||
// "prop": "typeDictValue",
|
|
||||||
// "name": "产品类型value,对应到数据字典label_value"
|
|
||||||
// },
|
|
||||||
// { "prop": "enabled", "name": "启用状态:0 、停用,1、启用" },
|
|
||||||
// { "prop": "remark", "name": "备注" },
|
|
||||||
// { "prop": "valid", "name": "删除标志,是否有效:1 可用 0不可用" },
|
|
||||||
// { "prop": "creatorId", "name": "创建人" },
|
|
||||||
// { "prop": "creatorName", "name": "创建人姓名" },
|
|
||||||
// { "prop": "createTime", "name": "添加时间" },
|
|
||||||
// { "prop": "updaterId", "name": "更新人" },
|
|
||||||
// { "prop": "updaterName", "name": "更新人姓名" },
|
|
||||||
// { "prop": "version", "name": "版本号" }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
const addOrUpdateConfigs = {
|
const addOrUpdateConfigs = {
|
||||||
@ -113,10 +94,9 @@ const addOrUpdateConfigs = {
|
|||||||
name: 'processTime',
|
name: 'processTime',
|
||||||
label: '加工时间',
|
label: '加工时间',
|
||||||
placeholder: '请输入加工时间',
|
placeholder: '请输入加工时间',
|
||||||
type: 'number', // type: number(input+number) | default(input) | textarea | select(options在父组件里获取) | datetime
|
type: 'number',
|
||||||
required: true,
|
required: true,
|
||||||
rules: [
|
rules: [
|
||||||
// 除了required之外的验证规则
|
|
||||||
{
|
{
|
||||||
type: 'number',
|
type: 'number',
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
@ -129,9 +109,6 @@ const addOrUpdateConfigs = {
|
|||||||
'specifications',
|
'specifications',
|
||||||
{
|
{
|
||||||
name: 'typeDictValue',
|
name: 'typeDictValue',
|
||||||
// rules: [
|
|
||||||
// {required: true, trigger: 'blur'}
|
|
||||||
// ],
|
|
||||||
label: '产品类型', // 对于非常见属性,最好自己指定label
|
label: '产品类型', // 对于非常见属性,最好自己指定label
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: [
|
options: [
|
||||||
@ -149,7 +126,6 @@ const addOrUpdateConfigs = {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
operations: [
|
operations: [
|
||||||
// { name: 'reset', url: true },
|
|
||||||
{ name: 'cancel', url: true, showAlways: true },
|
{ name: 'cancel', url: true, showAlways: true },
|
||||||
{ name: 'save', url: '/monitoring/product', permission: '', showOnEdit: false },
|
{ name: 'save', url: '/monitoring/product', permission: '', showOnEdit: false },
|
||||||
{ name: 'update', url: '/monitoring/product', permission: '', showOnEdit: true }
|
{ name: 'update', url: '/monitoring/product', permission: '', showOnEdit: true }
|
||||||
@ -166,13 +142,6 @@ const addOrUpdateConfigs = {
|
|||||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
// extraComponents: [
|
|
||||||
// {
|
|
||||||
// name: 'CompName',
|
|
||||||
// label: 'markdown编辑器',
|
|
||||||
// component: () => import('xx.vue')
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -195,7 +164,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
// AddOrUpdate,
|
||||||
BaseTable,
|
BaseTable,
|
||||||
BaseDialog
|
BaseDialog
|
||||||
},
|
},
|
||||||
@ -204,7 +173,6 @@ export default {
|
|||||||
this.addOrUpdateConfigs.fields.forEach(item => {
|
this.addOrUpdateConfigs.fields.forEach(item => {
|
||||||
if (item.name) {
|
if (item.name) {
|
||||||
if (item.name === 'typeDictValue') {
|
if (item.name === 'typeDictValue') {
|
||||||
console.log('dict : ', this.dictList)
|
|
||||||
item.options = this.dictList[ProductTypeDictTypeId]
|
item.options = this.dictList[ProductTypeDictTypeId]
|
||||||
} else if (item.name === 'unitDictValue') {
|
} else if (item.name === 'unitDictValue') {
|
||||||
item.options = this.dictList[UnitDictTypeId]
|
item.options = this.dictList[UnitDictTypeId]
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table> -->
|
</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
|
<el-pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@current-change="currentChangeHandle"
|
@current-change="currentChangeHandle"
|
||||||
@ -48,15 +48,16 @@
|
|||||||
>
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
<add-or-update v-if="addOrUpdateVisible" :configs="addOrUpdateConfigs" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './productArrt-add-or-update'
|
// import AddOrUpdate from './productArrt-add-or-update'
|
||||||
|
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||||
import BaseTable from '@/components/base-table'
|
import BaseTable from '@/components/base-table'
|
||||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||||
|
|
||||||
const tableConfigs = [
|
const tableConfigs = [
|
||||||
{ prop: 'createTime', name: '添加时间' },
|
{ prop: 'createTime', name: '添加时间' },
|
||||||
@ -79,9 +80,48 @@ const tableConfigs = [
|
|||||||
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const addOrUpdateConfigs = {
|
||||||
|
type: 'dialog',
|
||||||
|
infoUrl: '/monitoring/productArrt',
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'name',
|
||||||
|
label: '属性名称',
|
||||||
|
placeholder: '请输入属性名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'code',
|
||||||
|
label: '属性编码',
|
||||||
|
placeholder: '请输入属性编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'productId',
|
||||||
|
label: '关联产品',
|
||||||
|
type: 'select',
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'value',
|
||||||
|
label: '属性值',
|
||||||
|
placeholder: '请输入属性值'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'description',
|
||||||
|
label: '描述',
|
||||||
|
placeholder: '请输入描述'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
operations: [
|
||||||
|
{name: 'cancel', showAlways: true},
|
||||||
|
{name: 'save', url: '/monitoring/productArrt', permission: '', showOnEdit: false},
|
||||||
|
{name: 'update', url: '/monitoring/productArrt', permission: '', showOnEdit: true},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addOrUpdateConfigs,
|
||||||
tableConfigs,
|
tableConfigs,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key: ''
|
key: ''
|
||||||
@ -140,6 +180,14 @@ export default {
|
|||||||
selectionChangeHandle(val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val
|
||||||
},
|
},
|
||||||
|
handleOperations({type, data : id }) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
return this.addOrUpdateHandle(id)
|
||||||
|
case 'delete':
|
||||||
|
return this.deleteHandle(id)
|
||||||
|
}
|
||||||
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
addOrUpdateHandle(id) {
|
addOrUpdateHandle(id) {
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true
|
||||||
@ -162,7 +210,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/productArrt'),
|
url: this.$http.adornUrl('/monitoring/productArrt'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="getDataList()">查询</el-button>
|
<el-button @click="getDataList()">查询</el-button>
|
||||||
<el-button v-if="$hasPermission('monitoring:productionline:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
<el-button v-if="$hasPermission('monitoring:productionline:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
<!-- <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||||
@ -37,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table> -->
|
</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
|
<el-pagination
|
||||||
@size-change="sizeChangeHandle"
|
@size-change="sizeChangeHandle"
|
||||||
@current-change="currentChangeHandle"
|
@current-change="currentChangeHandle"
|
||||||
@ -49,15 +48,15 @@
|
|||||||
>
|
>
|
||||||
</el-pagination>
|
</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"></add-or-update>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './productionLine-add-or-update'
|
import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
|
||||||
import BaseTable from '@/components/base-table'
|
import BaseTable from '@/components/base-table'
|
||||||
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
import TableOperateComponent from '@/components/base-table/components/operationComponent'
|
||||||
import TableTextComponent from '@/components/base-table/components/detailComponent'
|
// import TableTextComponent from '@/components/base-table/components/detailComponent'
|
||||||
|
|
||||||
const tableConfigs = [
|
const tableConfigs = [
|
||||||
{ prop: 'createTime', name: '添加时间' },
|
{ prop: 'createTime', name: '添加时间' },
|
||||||
@ -67,28 +66,52 @@ const tableConfigs = [
|
|||||||
{ prop: 'status', name: '产线状态' },
|
{ prop: 'status', name: '产线状态' },
|
||||||
{ prop: 'description', name: '描述' },
|
{ prop: 'description', name: '描述' },
|
||||||
{ prop: 'remark', name: '备注' },
|
{ prop: 'remark', name: '备注' },
|
||||||
// { "prop": "tvalue", "name": "每小时下片数量" },
|
|
||||||
// { "prop": "externalCode", "name": "外部系统编码" },
|
|
||||||
// { "prop": "enabled", "name": "启用状态:0 、停用,1、启用" },
|
|
||||||
// { "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'] }
|
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const addOrUpdateConfigs = {
|
||||||
|
type: 'dialog',
|
||||||
|
infoUrl: '/monitoring/productionLine',
|
||||||
|
fields: [
|
||||||
|
'name',
|
||||||
|
{ name: 'code', api: '/monitoring/productionLine/getCode' },
|
||||||
|
{
|
||||||
|
name: 'factoryId',
|
||||||
|
label: '工厂',
|
||||||
|
type: 'select',
|
||||||
|
placeholder: '请选择所属工厂',
|
||||||
|
options: []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'tvalue',
|
||||||
|
label: '产线TT值(每小时下片数量)',
|
||||||
|
placeholder: '请输入合理数值',
|
||||||
|
type: 'number', // TODO: 可改进为自动应用 number 验证,此时还必须添加下述规则:
|
||||||
|
required: true,
|
||||||
|
rules: [
|
||||||
|
{type: 'number', transform: val => Number(val), trigger: 'blur', message: '请输入数字类型'}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
'description',
|
||||||
|
'remark'
|
||||||
|
],
|
||||||
|
operations: [
|
||||||
|
{ name: 'cancel', url: true, showAlways: true },
|
||||||
|
{ name: 'save', url: '/monitoring/productionLine', permission: '', showOnEdit: false },
|
||||||
|
{ name: 'update', url: '/monitoring/productionLine', permission: '', showOnEdit: true }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
addOrUpdateConfigs,
|
||||||
tableConfigs,
|
tableConfigs,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
key: ''
|
key: ''
|
||||||
},
|
},
|
||||||
dataList: [],
|
dataList: [],
|
||||||
|
factoryList: [],
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
totalPage: 0,
|
totalPage: 0,
|
||||||
@ -102,9 +125,26 @@ export default {
|
|||||||
BaseTable
|
BaseTable
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {
|
||||||
|
this.getFactoryList()
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取工厂列表
|
||||||
|
getFactoryList() {
|
||||||
|
this.$http.get(this.$http.adornUrl('/monitoring/factory/list')).then(({ data: res }) => {
|
||||||
|
if (res && res.code === 0) {
|
||||||
|
this.factoryList = res.data
|
||||||
|
} else {
|
||||||
|
this.factoryList.splice(0)
|
||||||
|
}
|
||||||
|
this.addOrUpdateConfigs.fields.forEach(item => {
|
||||||
|
if (item.name === 'factoryId') {
|
||||||
|
console.log('res' ,item)
|
||||||
|
item.options = this.factoryList.map(f => ({ value: f.id, label: f.name }))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true
|
this.dataListLoading = true
|
||||||
@ -142,6 +182,14 @@ export default {
|
|||||||
selectionChangeHandle(val) {
|
selectionChangeHandle(val) {
|
||||||
this.dataListSelections = val
|
this.dataListSelections = val
|
||||||
},
|
},
|
||||||
|
handleOperations({type, data: id}) {
|
||||||
|
switch (type) {
|
||||||
|
case 'edit':
|
||||||
|
return this.addOrUpdateHandle(id)
|
||||||
|
case 'delete':
|
||||||
|
return this.deleteHandle(id)
|
||||||
|
}
|
||||||
|
},
|
||||||
// 新增 / 修改
|
// 新增 / 修改
|
||||||
addOrUpdateHandle(id) {
|
addOrUpdateHandle(id) {
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true
|
||||||
@ -164,7 +212,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/productionLine'),
|
url: this.$http.adornUrl('/monitoring/productionLine'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -143,7 +143,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/productionLineRecSch'),
|
url: this.$http.adornUrl('/monitoring/productionLineRecSch'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -153,7 +153,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/qualityInspectionDet'),
|
url: this.$http.adornUrl('/monitoring/qualityInspectionDet'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -169,7 +169,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/qualityInspectionRecord'),
|
url: this.$http.adornUrl('/monitoring/qualityInspectionRecord'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -151,7 +151,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/qualityInspectionType'),
|
url: this.$http.adornUrl('/monitoring/qualityInspectionType'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -165,7 +165,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/reportSheet'),
|
url: this.$http.adornUrl('/monitoring/reportSheet'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -157,7 +157,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/reportSheetCategory'),
|
url: this.$http.adornUrl('/monitoring/reportSheetCategory'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -152,7 +152,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/sysFile'),
|
url: this.$http.adornUrl('/monitoring/sysFile'),
|
||||||
method: 'delete',
|
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false)
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
|
@ -150,7 +150,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/sysFileType'),
|
url: this.$http.adornUrl('/monitoring/sysFileType'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -162,7 +162,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/workshopSection'),
|
url: this.$http.adornUrl('/monitoring/workshopSection'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -153,7 +153,7 @@ export default {
|
|||||||
this.$http({
|
this.$http({
|
||||||
url: this.$http.adornUrl('/monitoring/workshopSectionEquipment'),
|
url: this.$http.adornUrl('/monitoring/workshopSectionEquipment'),
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
data: this.$http.adornData(ids, false)
|
data: this.$http.adornData(ids, false, 'raw')
|
||||||
}).then(({ data }) => {
|
}).then(({ data }) => {
|
||||||
if (data && data.code === 0) {
|
if (data && data.code === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
Loading…
Reference in New Issue
Block a user