|
|
|
|
@ -19,9 +19,7 @@ |
|
|
|
|
:beforeOpen="beforeOpen" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" |
|
|
|
|
>删除</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="danger" @click="handleDelete">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="{ row }"> |
|
|
|
|
<el-button type="text" @click="setTeam(row)">设置班组</el-button> |
|
|
|
|
@ -48,9 +46,7 @@ |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog title="设置工艺能力" append-to-body v-model="capacityDialog" width="60%"> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="insertEvent()" |
|
|
|
|
>插入一行</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="insertEvent()">插入一行</el-button> |
|
|
|
|
<el-button plain type="danger" @click="remove">删除选择行</el-button> |
|
|
|
|
<!-- <el-button type="primary" @click="handleSave">保存</el-button> --> |
|
|
|
|
</div> |
|
|
|
|
@ -69,19 +65,28 @@ |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.caName" |
|
|
|
|
:value="item.id" |
|
|
|
|
:disabled="isAbilitySelected(item.id, scope.$index)"> |
|
|
|
|
:disabled="isAbilitySelected(item.id, scope.$index)" |
|
|
|
|
> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="面积" prop="area"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-input-number v-model="scope.row.area" :min="0" controls-position="right"></el-input-number> |
|
|
|
|
<el-input-number |
|
|
|
|
v-model="scope.row.area" |
|
|
|
|
:min="0" |
|
|
|
|
controls-position="right" |
|
|
|
|
></el-input-number> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="数量" prop="quality"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-input-number v-model="scope.row.quality" :min="0" controls-position="right"></el-input-number> |
|
|
|
|
<el-input-number |
|
|
|
|
v-model="scope.row.quality" |
|
|
|
|
:min="0" |
|
|
|
|
controls-position="right" |
|
|
|
|
></el-input-number> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="批次" prop="batch"> |
|
|
|
|
@ -91,38 +96,53 @@ |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="饱和度(%)" prop="saturation"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
<el-input-number v-model="scope.row.saturation" :min="0" controls-position="right"></el-input-number> |
|
|
|
|
<el-input-number |
|
|
|
|
v-model="scope.row.saturation" |
|
|
|
|
:min="0" |
|
|
|
|
controls-position="right" |
|
|
|
|
></el-input-number> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="capacityDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitCapacity">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="capacityDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitCapacity">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
<script> |
|
|
|
|
import {getList,getNotSelectTeam,getSelectTeam,getAbility,addWorkCenter,updateWorkCenter,saveTeam, |
|
|
|
|
getSelectCraft,saveCraft,deleteWorkCenter,getAllUser} from "@/api/basicData/workCenter" |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
getNotSelectTeam, |
|
|
|
|
getSelectTeam, |
|
|
|
|
getAbility, |
|
|
|
|
addWorkCenter, |
|
|
|
|
updateWorkCenter, |
|
|
|
|
saveTeam, |
|
|
|
|
getSelectCraft, |
|
|
|
|
saveCraft, |
|
|
|
|
deleteWorkCenter, |
|
|
|
|
getAllUser, |
|
|
|
|
} from '@/api/basicData/workCenter'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loading: false, |
|
|
|
|
data: [], |
|
|
|
|
form: {}, |
|
|
|
|
query:{}, |
|
|
|
|
query: {}, |
|
|
|
|
capacityList: [], |
|
|
|
|
page: { |
|
|
|
|
pageSize: 10, |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
leaderUsers:[], |
|
|
|
|
abilityList:[], |
|
|
|
|
leaderUsers: [], |
|
|
|
|
abilityList: [], |
|
|
|
|
teamValue: [], |
|
|
|
|
capacityDialog: false, |
|
|
|
|
teamData: [], |
|
|
|
|
@ -131,8 +151,8 @@ export default { |
|
|
|
|
option: { |
|
|
|
|
columnSort: true, |
|
|
|
|
tip: false, |
|
|
|
|
height: "auto", |
|
|
|
|
align: "center", |
|
|
|
|
height: 'auto', |
|
|
|
|
align: 'center', |
|
|
|
|
// rowKey: "wcCode", |
|
|
|
|
calcHeight: 32, |
|
|
|
|
simplePage: false, |
|
|
|
|
@ -147,9 +167,9 @@ export default { |
|
|
|
|
viewBtn: false, |
|
|
|
|
delBtn: false, |
|
|
|
|
editBtn: true, |
|
|
|
|
editBtnText: "修改", |
|
|
|
|
editBtnIcon: " ", |
|
|
|
|
delBtnIcon: " ", |
|
|
|
|
editBtnText: '修改', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
addBtn: true, |
|
|
|
|
labelWidth: 120, |
|
|
|
|
searchLabelWidth: 100, |
|
|
|
|
@ -162,107 +182,113 @@ export default { |
|
|
|
|
gridBtn: false, |
|
|
|
|
searchShowBtn: false, |
|
|
|
|
showOverflowTooltip: true, |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchGutter: 24, |
|
|
|
|
searchSpan: 6, |
|
|
|
|
menuAlign: "center", |
|
|
|
|
menuAlign: 'center', |
|
|
|
|
gridBtn: false, |
|
|
|
|
searchMenuPosition: "right", |
|
|
|
|
addBtnIcon: " ", |
|
|
|
|
viewBtnIcon: " ", |
|
|
|
|
delBtnIcon: " ", |
|
|
|
|
editBtnIcon: " ", |
|
|
|
|
searchMenuPosition: 'right', |
|
|
|
|
addBtnIcon: ' ', |
|
|
|
|
viewBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: "编码", |
|
|
|
|
prop: "wcCode", |
|
|
|
|
label: '编码', |
|
|
|
|
prop: 'wcCode', |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入编码", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入编码', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "名称", |
|
|
|
|
prop: "wcName", |
|
|
|
|
label: '名称', |
|
|
|
|
prop: 'wcName', |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入名称", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入名称', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "工序", |
|
|
|
|
prop: "processes", |
|
|
|
|
label: '工序', |
|
|
|
|
prop: 'processes', |
|
|
|
|
span: 24, |
|
|
|
|
hide: true, |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入工序", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入工序', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "工艺能力", |
|
|
|
|
prop: "craftAbility", |
|
|
|
|
label: '工艺能力', |
|
|
|
|
prop: 'craftAbility', |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入工艺能力", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入工艺能力', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "业务标识", |
|
|
|
|
prop: "sign", |
|
|
|
|
label: '业务标识', |
|
|
|
|
prop: 'sign', |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入业务标识", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入业务标识', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "主管工艺员", |
|
|
|
|
prop: "leaderUserName", |
|
|
|
|
label: '主管工艺员', |
|
|
|
|
prop: 'leaderUserName', |
|
|
|
|
// type: "select", |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
// search: true, |
|
|
|
|
addDisplay:false, |
|
|
|
|
editDisplay:false, |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入主管工艺员", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入主管工艺员', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
// filterable:true, |
|
|
|
|
@ -276,76 +302,80 @@ export default { |
|
|
|
|
// }, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "主管工艺员", |
|
|
|
|
prop: "leaderUser", |
|
|
|
|
type: "select", |
|
|
|
|
label: '主管工艺员', |
|
|
|
|
prop: 'leaderUser', |
|
|
|
|
type: 'select', |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
hide:true, |
|
|
|
|
hide: true, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入主管工艺员", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入主管工艺员', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
// filterable:true, |
|
|
|
|
remote:true, |
|
|
|
|
dicUrl:"/api/blade-system/user/page?current=1&size=9999&realName={{key}}", |
|
|
|
|
|
|
|
|
|
remote: true, |
|
|
|
|
dicUrl: '/api/blade-system/user/page?current=1&size=9999&realName={{key}}', |
|
|
|
|
|
|
|
|
|
// dicUrl:"/blade-system/user/page?size=999999¤t=1", |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
label: "realName", |
|
|
|
|
value: "id", |
|
|
|
|
res:"data.records" |
|
|
|
|
label: 'realName', |
|
|
|
|
value: 'id', |
|
|
|
|
res: 'data.records', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "班组", |
|
|
|
|
prop: "team", |
|
|
|
|
label: '班组', |
|
|
|
|
prop: 'team', |
|
|
|
|
span: 24, |
|
|
|
|
addDisplay: false, |
|
|
|
|
editDisplay: false, |
|
|
|
|
overflow: true, |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入班组", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入班组', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "交付中心", |
|
|
|
|
prop: "jcId", |
|
|
|
|
type: "select", |
|
|
|
|
label: '交付中心', |
|
|
|
|
prop: 'jcId', |
|
|
|
|
type: 'select', |
|
|
|
|
span: 24, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
dicUrl:'/api/blade-system/dict/dictionary?code=workCenterJfCenter', //字典中取值 |
|
|
|
|
props:{ |
|
|
|
|
label:'dictValue', |
|
|
|
|
value:'dictKey', |
|
|
|
|
dicUrl: '/api/blade-system/dict/dictionary?code=workCenterJfCenter', //字典中取值 |
|
|
|
|
sortable: true, |
|
|
|
|
props: { |
|
|
|
|
label: 'dictValue', |
|
|
|
|
value: 'dictKey', |
|
|
|
|
}, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入交付中心", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入交付中心', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "描述", |
|
|
|
|
prop: "describe", |
|
|
|
|
type: "textarea", |
|
|
|
|
label: '描述', |
|
|
|
|
prop: 'describe', |
|
|
|
|
type: 'textarea', |
|
|
|
|
span: 24, |
|
|
|
|
hide: true, |
|
|
|
|
overflow: true, |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
// rules: [ |
|
|
|
|
// { |
|
|
|
|
// required: true, |
|
|
|
|
@ -355,13 +385,13 @@ export default { |
|
|
|
|
// ], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "是否检验标记", |
|
|
|
|
prop: "checkout", |
|
|
|
|
type: "switch", |
|
|
|
|
label: '是否检验标记', |
|
|
|
|
prop: 'checkout', |
|
|
|
|
type: 'switch', |
|
|
|
|
// type: "checkbox", |
|
|
|
|
dicData: [ |
|
|
|
|
{ label:"否", value:0}, |
|
|
|
|
{ label: "是", value: 1 }, |
|
|
|
|
{ label: '否', value: 0 }, |
|
|
|
|
{ label: '是', value: 1 }, |
|
|
|
|
], |
|
|
|
|
// dicData: [{ label: "检验标记", value: 1 }], |
|
|
|
|
span: 24, |
|
|
|
|
@ -377,13 +407,13 @@ export default { |
|
|
|
|
// ], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "是否镀后标记", |
|
|
|
|
prop: "whetherPlate", |
|
|
|
|
label: '是否镀后标记', |
|
|
|
|
prop: 'whetherPlate', |
|
|
|
|
// type: "checkbox", |
|
|
|
|
type: "switch", |
|
|
|
|
type: 'switch', |
|
|
|
|
dicData: [ |
|
|
|
|
{ label:"否", value:0}, |
|
|
|
|
{ label: "是", value: 1 }, |
|
|
|
|
{ label: '否', value: 0 }, |
|
|
|
|
{ label: '是', value: 1 }, |
|
|
|
|
], |
|
|
|
|
// dicData: [{ label: "镀后标记", value: 1 }], |
|
|
|
|
span: 24, |
|
|
|
|
@ -399,13 +429,13 @@ export default { |
|
|
|
|
// ], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "是否大批量", |
|
|
|
|
prop: "bigBatch", |
|
|
|
|
label: '是否大批量', |
|
|
|
|
prop: 'bigBatch', |
|
|
|
|
// type: "checkbox", |
|
|
|
|
type:"switch", |
|
|
|
|
dicData:[ |
|
|
|
|
{ label:"否", value:0}, |
|
|
|
|
{ label: "是", value: 1 }, |
|
|
|
|
type: 'switch', |
|
|
|
|
dicData: [ |
|
|
|
|
{ label: '否', value: 0 }, |
|
|
|
|
{ label: '是', value: 1 }, |
|
|
|
|
], |
|
|
|
|
// dicData: [{ label: "是否大批量", value: 1 }], |
|
|
|
|
span: 24, |
|
|
|
|
@ -422,64 +452,62 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
checkId:'' |
|
|
|
|
checkId: '', |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getAbilityData() |
|
|
|
|
this.getAbilityData(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
searchChange(params, done){ |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset(){ |
|
|
|
|
this.query = {} |
|
|
|
|
this.onLoad() |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage){ |
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
}, |
|
|
|
|
sizeChange(pageSize){ |
|
|
|
|
sizeChange(pageSize) { |
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type){ |
|
|
|
|
if(type == 'edit'){ |
|
|
|
|
console.log('form',this.form) |
|
|
|
|
this.form.jcId = this.form.jcId + '' |
|
|
|
|
this.form.leaderUser = this.form.leaderUser + '' |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
if (type == 'edit') { |
|
|
|
|
console.log('form', this.form); |
|
|
|
|
this.form.jcId = this.form.jcId + ''; |
|
|
|
|
this.form.leaderUser = this.form.leaderUser + ''; |
|
|
|
|
// this.form.checkout = this.form.checkout == 1 ? [1] : [] |
|
|
|
|
// this.form.bigBatch = this.form.bigBatch == 1 ? [1] : [] |
|
|
|
|
// this.form.whetherPlate = this.form.whetherPlate == 1 ? [1] : [] |
|
|
|
|
|
|
|
|
|
this.form.checkout = this.form.checkout == 1 ? 1 : 0 |
|
|
|
|
this.form.bigBatch = this.form.bigBatch == 1 ? 1 : 0 |
|
|
|
|
this.form.whetherPlate = this.form.whetherPlate == 1 ? 1 : 0 |
|
|
|
|
|
|
|
|
|
this.form.checkout = this.form.checkout == 1 ? 1 : 0; |
|
|
|
|
this.form.bigBatch = this.form.bigBatch == 1 ? 1 : 0; |
|
|
|
|
this.form.whetherPlate = this.form.whetherPlate == 1 ? 1 : 0; |
|
|
|
|
|
|
|
|
|
getAllUser({current:1,size:300}).then(res => { |
|
|
|
|
this.leaderUsers = res.data.data.records |
|
|
|
|
let tmp = this.leaderUsers.find(item => item.id == this.form.leaderUser) |
|
|
|
|
if(!tmp){ |
|
|
|
|
getAllUser({ current: 1, size: 300 }).then(res => { |
|
|
|
|
this.leaderUsers = res.data.data.records; |
|
|
|
|
let tmp = this.leaderUsers.find(item => item.id == this.form.leaderUser); |
|
|
|
|
if (!tmp) { |
|
|
|
|
getAllUser({ |
|
|
|
|
realName:this.form.leaderUserName |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.leaderUsers = [...this.leaderUsers, ...res.data.data.records] |
|
|
|
|
done() |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
done() |
|
|
|
|
realName: this.form.leaderUserName, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.leaderUsers = [...this.leaderUsers, ...res.data.data.records]; |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
done() |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading){ |
|
|
|
|
console.log('row----------',row) |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
console.log('row----------', row); |
|
|
|
|
// let params = { |
|
|
|
|
// ...row, |
|
|
|
|
// checkout:row.checkout.length != 0 ? 1 : 0, |
|
|
|
|
@ -489,20 +517,20 @@ export default { |
|
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
...row, |
|
|
|
|
checkout:row.checkout == 1 ? 1 : 0, |
|
|
|
|
bigBatch:row.bigBatch == 1 ? 1 : 0, |
|
|
|
|
whetherPlate:row.whetherPlate == 1 ? 1 : 0, |
|
|
|
|
} |
|
|
|
|
checkout: row.checkout == 1 ? 1 : 0, |
|
|
|
|
bigBatch: row.bigBatch == 1 ? 1 : 0, |
|
|
|
|
whetherPlate: row.whetherPlate == 1 ? 1 : 0, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
addWorkCenter(params).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
addWorkCenter(params).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('新增成功'); |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading){ |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
// let params = { |
|
|
|
|
// ...row, |
|
|
|
|
// checkout:row.checkout.length != 0 ? 1 : 0, |
|
|
|
|
@ -512,90 +540,90 @@ export default { |
|
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
...row, |
|
|
|
|
checkout:row.checkout == 1 ? 1 : 0, |
|
|
|
|
bigBatch:row.bigBatch == 1 ? 1 : 0, |
|
|
|
|
whetherPlate:row.whetherPlate == 1 ? 1 : 0, |
|
|
|
|
} |
|
|
|
|
checkout: row.checkout == 1 ? 1 : 0, |
|
|
|
|
bigBatch: row.bigBatch == 1 ? 1 : 0, |
|
|
|
|
whetherPlate: row.whetherPlate == 1 ? 1 : 0, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
updateWorkCenter(params).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
updateWorkCenter(params).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 设置班组 |
|
|
|
|
async setTeam(row) { |
|
|
|
|
this.checkId = row.id |
|
|
|
|
this.checkId = row.id; |
|
|
|
|
// this.teamValue = row.teamValue && row.teamValue != "" ? row.teamValue.split(",") : []; |
|
|
|
|
// console.log("teamValue=================", this.teamValue); |
|
|
|
|
const selectTeam = await getSelectTeam({id: row.id,}); |
|
|
|
|
const noSelectTeam = await getNotSelectTeam({id: row.id,}); |
|
|
|
|
console.log('selectTeam-----------',selectTeam) |
|
|
|
|
console.log('noSelectTeam-----------',noSelectTeam) |
|
|
|
|
this.teamData = [...noSelectTeam.data.data,...selectTeam.data.data] |
|
|
|
|
this.teamValue = selectTeam.data.data.map(item => item.id) |
|
|
|
|
console.log('teamValue-----------',this.teamValue) |
|
|
|
|
const selectTeam = await getSelectTeam({ id: row.id }); |
|
|
|
|
const noSelectTeam = await getNotSelectTeam({ id: row.id }); |
|
|
|
|
console.log('selectTeam-----------', selectTeam); |
|
|
|
|
console.log('noSelectTeam-----------', noSelectTeam); |
|
|
|
|
this.teamData = [...noSelectTeam.data.data, ...selectTeam.data.data]; |
|
|
|
|
this.teamValue = selectTeam.data.data.map(item => item.id); |
|
|
|
|
console.log('teamValue-----------', this.teamValue); |
|
|
|
|
this.teamDialog = true; |
|
|
|
|
}, |
|
|
|
|
submitTeam(){ |
|
|
|
|
console.log('this.teamValue-----------',this.teamValue) |
|
|
|
|
submitTeam() { |
|
|
|
|
console.log('this.teamValue-----------', this.teamValue); |
|
|
|
|
let params = { |
|
|
|
|
id:this.checkId, |
|
|
|
|
teamIds:this.teamValue |
|
|
|
|
} |
|
|
|
|
id: this.checkId, |
|
|
|
|
teamIds: this.teamValue, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
saveTeam(params).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
saveTeam(params).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('班组设置成功'); |
|
|
|
|
this.teamDialog = false |
|
|
|
|
this.onLoad() |
|
|
|
|
this.teamDialog = false; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
submitCapacity(){ |
|
|
|
|
if(this.capacityList.length == 0){ |
|
|
|
|
this.$message.error('请至少填写一条数据') |
|
|
|
|
return |
|
|
|
|
submitCapacity() { |
|
|
|
|
if (this.capacityList.length == 0) { |
|
|
|
|
this.$message.error('请至少填写一条数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 校验工艺能力是否必选 |
|
|
|
|
const emptyAbility = this.capacityList.find(item => !item.id); |
|
|
|
|
if(emptyAbility){ |
|
|
|
|
this.$message.error('工艺能力为必选项,请选择工艺能力') |
|
|
|
|
return |
|
|
|
|
if (emptyAbility) { |
|
|
|
|
this.$message.error('工艺能力为必选项,请选择工艺能力'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// console.log('this.capacityList-----------',this.capacityList) |
|
|
|
|
// 校验通过:准备提交数据(过滤无用字段) |
|
|
|
|
const submitData = this.capacityList.map(row => { |
|
|
|
|
const { _select, ...validData } = row; // 剔除选择状态字段 |
|
|
|
|
return validData; |
|
|
|
|
}); |
|
|
|
|
const submitData = this.capacityList.map(row => { |
|
|
|
|
const { _select, ...validData } = row; // 剔除选择状态字段 |
|
|
|
|
return validData; |
|
|
|
|
}); |
|
|
|
|
let params = { |
|
|
|
|
id:this.checkId, |
|
|
|
|
crafs:submitData |
|
|
|
|
} |
|
|
|
|
console.log('params-----------',params) |
|
|
|
|
saveCraft(params).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
id: this.checkId, |
|
|
|
|
crafs: submitData, |
|
|
|
|
}; |
|
|
|
|
console.log('params-----------', params); |
|
|
|
|
saveCraft(params).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('工艺能力设置成功'); |
|
|
|
|
this.capacityDialog = false |
|
|
|
|
this.onLoad() |
|
|
|
|
this.capacityDialog = false; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getAbilityData(){ |
|
|
|
|
getAbility().then(res =>{ |
|
|
|
|
this.abilityList = res.data.data |
|
|
|
|
}) |
|
|
|
|
getAbilityData() { |
|
|
|
|
getAbility().then(res => { |
|
|
|
|
this.abilityList = res.data.data; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 设置工艺能力 |
|
|
|
|
setCapability(row){ |
|
|
|
|
this.checkId = row.id |
|
|
|
|
getSelectCraft({id:row.id}).then(res =>{ |
|
|
|
|
this.capacityList = res.data.data |
|
|
|
|
this.capacityDialog = true |
|
|
|
|
}) |
|
|
|
|
setCapability(row) { |
|
|
|
|
this.checkId = row.id; |
|
|
|
|
getSelectCraft({ id: row.id }).then(res => { |
|
|
|
|
this.capacityList = res.data.data; |
|
|
|
|
this.capacityDialog = true; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 工艺能力插入一行 |
|
|
|
|
insertEvent() { |
|
|
|
|
@ -616,22 +644,22 @@ export default { |
|
|
|
|
row._select = !row._select; |
|
|
|
|
}, |
|
|
|
|
remove() { |
|
|
|
|
let arr = this.capacityList.filter((item) => item._select); |
|
|
|
|
let arr = this.capacityList.filter(item => item._select); |
|
|
|
|
if (arr.length != 0) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.rowId) { |
|
|
|
|
let deleteData = this.capacityList.filter((item) => item._select); |
|
|
|
|
this.deleteTidArr = deleteData.filter((item) => item.tidId); |
|
|
|
|
let deleteData = this.capacityList.filter(item => item._select); |
|
|
|
|
this.deleteTidArr = deleteData.filter(item => item.tidId); |
|
|
|
|
} |
|
|
|
|
let deleteArr = this.capacityList.filter((item) => !item._select); |
|
|
|
|
let deleteArr = this.capacityList.filter(item => !item._select); |
|
|
|
|
this.capacityList = deleteArr; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error("请至少选择一条数据进行操作!"); |
|
|
|
|
this.$message.error('请至少选择一条数据进行操作!'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleSave() { |
|
|
|
|
@ -650,33 +678,33 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.error("请至少选择一条数据"); |
|
|
|
|
this.$message.error('请至少选择一条数据'); |
|
|
|
|
} else { |
|
|
|
|
this.$confirm("确定删除选中数据?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('确定删除选中数据?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
deleteWorkCenter({ |
|
|
|
|
ids: this.selectionList.map(item => item.id).join(","), |
|
|
|
|
}).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
ids: this.selectionList.map(item => item.id).join(','), |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.onLoad() |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
getList({ |
|
|
|
|
current:this.page.currentPage, |
|
|
|
|
size:this.page.pageSize, |
|
|
|
|
...this.query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.page.total = res.data.data.total |
|
|
|
|
}) |
|
|
|
|
current: this.page.currentPage, |
|
|
|
|
size: this.page.pageSize, |
|
|
|
|
...this.query, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.page.total = res.data.data.total; |
|
|
|
|
}); |
|
|
|
|
// this.data = [ |
|
|
|
|
// { |
|
|
|
|
// area: 0.0, |
|
|
|
|
|