Commit f8d39ca9 authored by 李苏's avatar 李苏 💬

cell调整

parent 9463fe06
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
<template #toolbar="ctx"> <template #toolbar="ctx">
<!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 --> <!-- 嵌入默认页面工具栏的插槽 ctx.pagePage来操作默认页面 -->
<!-- <el-button @click="demo(ctx.basePage)" size='mini' type="primary">示例按钮</el-button> --> <!-- <el-button @click="demo(ctx.basePage)" size='mini' type="primary">示例按钮</el-button> -->
<el-button @click="execute(ctx.basePage)" size='mini' type="primary">手动执行</el-button> <el-button @click="execute(ctx.basePage)" size='mini' type="primary">手动执行</el-button>
<el-button @click="complete(ctx.basePage)" size='mini' type="primary">完成</el-button> <el-button @click="complete(ctx.basePage)" size='mini' type="primary">完成</el-button>
<el-button @click="close(ctx.basePage)" size='mini' type="primary">关闭</el-button> <el-button @click="close(ctx.basePage)" size='mini' type="primary">关闭</el-button>
</template> </template>
</BasePage> </BasePage>
...@@ -20,25 +20,52 @@ ...@@ -20,25 +20,52 @@
data() { data() {
return { return {
power: { power: {
add: false, add: false,
copy: false, copy: false,
/* 手动控制删除 */ /* 手动控制删除 */
delButton: true, delButton: true,
/* 手动控制编辑按钮权限 */ /* 手动控制编辑按钮权限 */
editButton: false, editButton: false,
/* 是否渲染右侧操作按钮 */ /* 是否渲染右侧操作按钮 */
operateButtons: false, operateButtons: false,
/* 是否开启工作流按钮 */ /* 是否开启工作流按钮 */
workFlow: false, workFlow: false,
/* 表格开启选择,以及记住选择 */ /* 表格开启选择,以及记住选择 */
showSelection: false, showSelection: false,
saveSelected: false saveSelected: false
}, },
config: { config: {
cellStyle({
row,
column,
}) {
// 定义样式变量
let cellStyle;
switch (row.zt) {
case 'W':
cellStyle = 'color:#dcc40e';
break;
case 'D':
cellStyle = 'color:#76b82a';
break;
case 'C':
cellStyle = 'color:#60b5ff';
break;
case 'CF':
cellStyle = 'color:#666';
break;
default:
cellStyle = '';
}
if (column.label == "状态") {
return cellStyle
}
},
/* 基本配置*/ /* 基本配置*/
url: 'lxyl/wcs/wcsTask', url: 'lxyl/wcs/wcsTask',
tableTitle: [ tableTitle: [{
{
title: "状态", title: "状态",
field: "zt", field: "zt",
width: 80, width: 80,
...@@ -66,16 +93,16 @@ ...@@ -66,16 +93,16 @@
{ {
title: "起始位", title: "起始位",
field: "gwName", field: "gwName",
formatter(row,b,v){ formatter(row, b, v) {
return row.kwName||row.gwName return row.kwName || row.gwName
}, },
width: 140, width: 140,
}, },
{ {
title: "目标位", title: "目标位",
field: "mbkwCode", field: "mbkwCode",
formatter(row,b,v){ formatter(row, b, v) {
return row.mbkwCode||row.mbgwCode||row.gwName return row.mbkwCode || row.mbgwCode || row.gwName
}, },
width: 140, width: 140,
}, },
...@@ -144,7 +171,7 @@ ...@@ -144,7 +171,7 @@
// return id // return id
// } // }
}, },
{ {
title: "创建人", title: "创建人",
field: "cjr" field: "cjr"
...@@ -197,14 +224,13 @@ ...@@ -197,14 +224,13 @@
], ],
[ [{
{ label: '任务号',
label: '任务号', prop: 'djid',
prop: 'djid', span: 8,
span: 8, type: 'input',
type: 'input', value: ''
value: '' },
},
{ {
"label": "业务类型", "label": "业务类型",
"prop": "djly", "prop": "djly",
...@@ -235,78 +261,78 @@ ...@@ -235,78 +261,78 @@
}, },
methods: { methods: {
execute(ctx){ execute(ctx) {
if (ctx.singleItem && ctx.singleItem.id) { if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('确定要重新执行任务吗?', '提示', { this.$confirm('确定要重新执行任务吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(res => { }).then(res => {
ctx.$refs.TablePager.loading=true ctx.$refs.TablePager.loading = true
this.$post('lxyl/wcs/wcsTask/start', { this.$post('lxyl/wcs/wcsTask/start', {
id: ctx.singleItem.id id: ctx.singleItem.id
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$success('操作成功') this.$success('操作成功')
ctx.$refs.TablePager.loading=false ctx.$refs.TablePager.loading = false
ctx.refresh() ctx.refresh()
} }
}).finally(res=>{ }).finally(res => {
ctx.$refs.TablePager.loading=false ctx.$refs.TablePager.loading = false
}) })
}) })
} else { } else {
this.$warning('请选中一条数据') this.$warning('请选中一条数据')
} }
}, },
close(ctx){ close(ctx) {
if (ctx.singleItem && ctx.singleItem.id) { if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('确定要关闭任务吗?', '提示', { this.$confirm('确定要关闭任务吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(res => { }).then(res => {
ctx.$refs.TablePager.loading=true ctx.$refs.TablePager.loading = true
this.$post('lxyl/wcs/wcsTask/close', { this.$post('lxyl/wcs/wcsTask/close', {
id: ctx.singleItem.id id: ctx.singleItem.id
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$success('操作成功') this.$success('操作成功')
ctx.$refs.TablePager.loading=false ctx.$refs.TablePager.loading = false
ctx.refresh() ctx.refresh()
} }
}).finally(res=>{ }).finally(res => {
ctx.$refs.TablePager.loading=false ctx.$refs.TablePager.loading = false
}) })
}) })
} else { } else {
this.$warning('请选中一条数据') this.$warning('请选中一条数据')
} }
}, },
complete(ctx){ complete(ctx) {
if (ctx.singleItem && ctx.singleItem.id) { if (ctx.singleItem && ctx.singleItem.id) {
this.$confirm('确定要完成任务吗?', '提示', { this.$confirm('确定要完成任务吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(res => { }).then(res => {
ctx.$refs.TablePager.loading=true ctx.$refs.TablePager.loading = true
this.$post('lxyl/wcs/wcsTask/complete', { this.$post('lxyl/wcs/wcsTask/complete', {
id: ctx.singleItem.id id: ctx.singleItem.id
}).then(res => { }).then(res => {
if (res.success) { if (res.success) {
this.$success('操作成功') this.$success('操作成功')
ctx.$refs.TablePager.loading=false ctx.$refs.TablePager.loading = false
ctx.refresh() ctx.refresh()
} }
}).finally(res=>{ }).finally(res => {
ctx.$refs.TablePager.loading=false ctx.$refs.TablePager.loading = false
}) })
}) })
} else { } else {
this.$warning('请选中一条数据') this.$warning('请选中一条数据')
} }
} }
/* 示例*/ /* 示例*/
// demo(basePage){ // demo(basePage){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment