vm = new Vue({
el: '#app',
data: {
columns3: [
{
title: '操作',
key: 'no',
width: 60,
render: (h, params) => {
return h('div', [
h('Button', {
props: {
type: 'info',
size: 'small',
//long:'100%'
shape: 'circle',
disabled: vm.TableInfo.F_Status == '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH' ? true : false
},
style: {
//marginRight: '5px',
width: '100%',
display: 'block'
},
on: {
click: () => {
vm.btn_AddProductiveProcess();
}
}
}, '+'),
h('Button', {
props: {
type: 'default',
size: 'small',
//long: '100%'
shape: 'circle',
disabled: vm.TableInfo.F_Status == '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH' ? true : false
},
style: {
width: '100%'
},
on: {
click: () => {
vm.handleRemove(params.row)
}
}
}, '-')])
}
},
{
title: '加工時(shí)間',
key: 'F_WorkTime',
width: 90,
align: 'center',
render: (h, params) => {
let createtime = (params.row.F_WorkTime != null && params.row.F_WorkTime != '') ? new Date(params.row.F_WorkTime).Format("yyyy-MM-dd") : '';
if (params.row.$isEdit) {
return h('DatePicker', {
props: {
value: createtime,
},
on: {
'on-change': function (event) {
params.row.F_WorkTime = event;
vm.handleSave(params.row);
},
}
});
} else {
return h('div',
{
style: { color: createtime == '' ? 'red' : '' },
on: {
click: function (event) {
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH') {
vm.handleEdit(params.row);
}
}
}
},
createtime == '' ? '請輸入' : createtime);
}
}
},
{
title: '工序名稱',
width: 80,
align: 'center',
key: 'F_Procedure_Name',
},
{
title: '加工數(shù)量',
key: 'F_Machining_Nums',
width: 80,
align: 'center',
render: (h, params) => {
if (params.row.$isEdit) {
return h('InputNumber', {
props: {
value: params.row.F_Machining_Nums,
max: vm.TableInfo.F_Product_Nums,
min: 0,
},
on: {
input: function (event) {
params.row.F_Machining_Nums = event;
},
'on-blur': function () {
vm.handleSave(params.row);
}
}
});
} else {
return h('div', {
style: { color: params.row.F_Machining_Nums == '' ? 'red' : '' },
on: {
click: function (event) {
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH') {
vm.handleEdit(params.row);
}
}
}
}, params.row.F_Machining_Nums == 0 ? '請輸入' : params.row.F_Machining_Nums);
}
}
},
{
title: '車間人員',
key: 'F_Worker',
width: 79,
align: 'center',
render: (h, params) => {
if (params.row.$isEdit) {
return h('Input', {
props: {
value: params.row.F_Worker,
},
on: {
input: function (event) {
params.row.F_Worker = event;
},
'on-blur': function () {
vm.handleSave(params.row);
}
}
});
} else {
return h('div', {
style: { color: (params.row.F_Worker == '' || params.row.F_Worker == null) ? 'red' : '' },
on: {
click: function (event) {
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH') {
vm.handleEdit(params.row);
}
}
}
}, (params.row.F_Worker == '' || params.row.F_Worker == null) ? '請輸入' : params.row.F_Worker);
}
}
},
{
title: '合格數(shù)量',
key: 'F_Qualified_Nums',
width: 80,
align: 'center',
render: (h, params) => {
if (params.row.$isEdit) {
return h('InputNumber', {
props: {
value: params.row.F_Qualified_Nums,
max: vm.TableInfo.F_Product_Nums,
min:0
},
on: {
input: function (event) {
params.row.F_Qualified_Nums = event;
},
'on-blur': function () {
vm.handleSave(params.row);
}
}
});
} else {
return h('div', {
style: { color: (params.row.F_Qualified_Nums == 0 && params.row.F_Unqualified_Nums == 0) ? 'red' : '' },
on: {
click: function (event) {
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH') {
vm.handleEdit(params.row);
}
}
}
}, (params.row.F_Qualified_Nums == 0 && params.row.F_Unqualified_Nums == 0) ? '請輸入' : params.row.F_Qualified_Nums);
}
}
},
{
title: '外協(xié)',
key: 'F_IsOutProcess_',
width: 105,
align: 'center',
render: (h, params) => {
if (params.row.$isEdit) {
return h('radio-group', {
props: {
type: 'button',
size: 'small',
value: params.row.F_IsOutProcess == true ? "是" : "否",
},
},
[
h('Radio', {
props: {
label: '是'
},
on: {
input: () => {
params.row.F_IsOutProcess = true;
params.row.F_IsOutProcess_ = "是";
vm.handleSave(params.row);
}
}
}, '是'),
h('Radio', {
props: {
label: '否'
},
on: {
input: () => {
params.row.F_IsOutProcess = false;
params.row.F_IsOutProcess_ = "否";
vm.handleSave(params.row);
}
}
}, '否'),
]);
} else {
return h('div', {
on: {
click: function (event) {
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH') {
vm.handleEdit(params.row);
}
}
}
}, params.row.F_IsOutProcess == true ? "是" : "否",);
}
}
},
],
}})