parent
cbd4e907b9
commit
2e8f51e587
26 changed files with 367 additions and 664 deletions
@ -1,431 +0,0 @@ |
|||||||
<template> |
|
||||||
<div style="width: 100%"> |
|
||||||
<el-form |
|
||||||
ref="form" |
|
||||||
:model="dsCraftMold" |
|
||||||
:rules="rules" |
|
||||||
class="vd-form" |
|
||||||
label-width="80px" |
|
||||||
size="mini" |
|
||||||
v-if="!disabled" |
|
||||||
> |
|
||||||
<el-row> |
|
||||||
<el-col :span="8"> |
|
||||||
<!-- 级别 --> |
|
||||||
<el-form-item :label="'工艺级别'" prop="rank"> |
|
||||||
<el-select v-model="dsCraftMold.rank" :placeholder="'请选择'" clearable filterable> |
|
||||||
<el-option |
|
||||||
v-for="item in rankList" |
|
||||||
:key="item.value" |
|
||||||
:label="item.label" |
|
||||||
:value="item.value" |
|
||||||
/> |
|
||||||
</el-select> |
|
||||||
</el-form-item> |
|
||||||
</el-col> |
|
||||||
<el-col :span="8"> |
|
||||||
<!-- 生产标识 --> |
|
||||||
<el-form-item :label="'生产标识'" prop="qualityGrade"> |
|
||||||
<procedure-qua |
|
||||||
v-model="dsCraftMold.qualityGrade" |
|
||||||
:option="procedureQuaOption" |
|
||||||
multiple |
|
||||||
style="width: 120px" |
|
||||||
@change="procedureQuaChange" |
|
||||||
/> |
|
||||||
<el-select v-model="dsCraftMold.qualityGrade" :placeholder="'请选择'" clearable filterable> |
|
||||||
<el-option |
|
||||||
v-for="item in rankList" |
|
||||||
:key="item.value" |
|
||||||
:label="item.label" |
|
||||||
:value="item.value" |
|
||||||
/> |
|
||||||
</el-select> |
|
||||||
</el-form-item> |
|
||||||
</el-col> |
|
||||||
</el-row> |
|
||||||
</el-form> |
|
||||||
<el-tabs v-model="activeName" type="border-card"> |
|
||||||
<!-- 工艺维护 --> |
|
||||||
<el-tab-pane :label="'工序'" name="1"> |
|
||||||
<avue-crud |
|
||||||
ref="crud" |
|
||||||
:option="dsProcessOption" |
|
||||||
:data="data" |
|
||||||
@row-update="rowUpdate" |
|
||||||
@row-save="rowSave" |
|
||||||
@row-click="handleRowClick" |
|
||||||
> |
|
||||||
<template #menu-left="{}"> |
|
||||||
<el-button @click="addRow">删除选择行</el-button> |
|
||||||
</template> |
|
||||||
<template #menu-right="{}"> |
|
||||||
<el-cascader |
|
||||||
v-model="cascaderValue" |
|
||||||
:props="{ expandTrigger: 'hover' }" |
|
||||||
:options="cascaderOptions" |
|
||||||
style="width: 260px; height: 30px; margin: 0 12px" |
|
||||||
class="proModel" |
|
||||||
@change="handleChange" |
|
||||||
/> |
|
||||||
<el-button @click="importTemplate">导入模板 </el-button> |
|
||||||
</template> |
|
||||||
<template #menu="{ row, index }"> |
|
||||||
<el-button |
|
||||||
text |
|
||||||
type="primary" |
|
||||||
:icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" |
|
||||||
@click="rowCell(row, index)" |
|
||||||
> |
|
||||||
{{ row.$cellEdit ? '保存' : '修改' }} |
|
||||||
</el-button> |
|
||||||
<el-button |
|
||||||
v-if="row.$cellEdit" |
|
||||||
text |
|
||||||
icon="el-icon-cancel" |
|
||||||
type="primary" |
|
||||||
@click="rowCancel(row, index)" |
|
||||||
> |
|
||||||
取消 |
|
||||||
</el-button> |
|
||||||
</template> |
|
||||||
</avue-crud> |
|
||||||
</el-tab-pane> |
|
||||||
</el-tabs> |
|
||||||
</div> |
|
||||||
</template> |
|
||||||
<script> |
|
||||||
import { getProcessManagementAuthorized } from '@/api/processManagement/taskProcessing'; |
|
||||||
|
|
||||||
export default { |
|
||||||
name: 'CraftIndex', |
|
||||||
components: {}, |
|
||||||
props: { |
|
||||||
height: { |
|
||||||
type: Number, |
|
||||||
default: 600, |
|
||||||
}, |
|
||||||
partId: { |
|
||||||
type: [Number, String], |
|
||||||
default: null, |
|
||||||
}, |
|
||||||
dialogType: { |
|
||||||
type: String, |
|
||||||
default: '', |
|
||||||
}, |
|
||||||
}, |
|
||||||
data() { |
|
||||||
// var checkCraftNo = (rule, value, callback) => { |
|
||||||
// if (!value) { |
|
||||||
// return callback( |
|
||||||
// new Error(this.$t('videaVueLib.publics.form.placeholder.input')) |
|
||||||
// ); |
|
||||||
// } |
|
||||||
// this.$ajax |
|
||||||
// .post('dsCraft/checkCraftNoUnique', { |
|
||||||
// craftId: this.dsCraftMold.craftId, |
|
||||||
// partId: this.partId, |
|
||||||
// craftNo: value |
|
||||||
// }) |
|
||||||
// .then((res) => { |
|
||||||
// if (res.data) { |
|
||||||
// callback(new Error(this.$t('craft.checkCraftNoUnique'))); |
|
||||||
// } else { |
|
||||||
// callback(); |
|
||||||
// } |
|
||||||
// }); |
|
||||||
// }; |
|
||||||
return { |
|
||||||
disabled: false, |
|
||||||
craftWay: '', |
|
||||||
dsCraftMold: { |
|
||||||
qualityGrade: [], |
|
||||||
quGrText: [], |
|
||||||
dsPart: { partId: this.partId }, |
|
||||||
priority: 3, |
|
||||||
craftNo: 'C000000', |
|
||||||
rank: 2, |
|
||||||
}, |
|
||||||
procedureQuaOption: [], |
|
||||||
activeName: '1', |
|
||||||
craftId: null, |
|
||||||
priorityList: [ |
|
||||||
{ |
|
||||||
label: '本次使用', |
|
||||||
value: 1, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '正式工艺', |
|
||||||
value: 2, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '临时工艺', |
|
||||||
value: 3, |
|
||||||
}, |
|
||||||
], |
|
||||||
rankList: [ |
|
||||||
{ |
|
||||||
label: '一级', |
|
||||||
value: 1, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '二级', |
|
||||||
value: 2, |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '三级', |
|
||||||
value: 3, |
|
||||||
}, |
|
||||||
], |
|
||||||
rules: { |
|
||||||
priority: [{ required: true }], |
|
||||||
rank: [{ required: true }], |
|
||||||
}, |
|
||||||
procedureQuaList: [], |
|
||||||
dsProcessOption: { |
|
||||||
submitBtn: false, |
|
||||||
emptyBtn: false, |
|
||||||
addBtn: false, |
|
||||||
editBtn: false, |
|
||||||
addRowBtn: true, |
|
||||||
addRowBtnText: '插入一行', |
|
||||||
cellBtn: false, |
|
||||||
cancelBtn: false, |
|
||||||
menu: false, |
|
||||||
selection: true, |
|
||||||
tip: false, |
|
||||||
border: true, |
|
||||||
searchLabelPosition: 'left', |
|
||||||
searchGutter: 24, |
|
||||||
searchSpan: 6, |
|
||||||
menuAlign: 'left', |
|
||||||
gridBtn: false, |
|
||||||
searchMenuPosition: 'right', |
|
||||||
addBtnIcon: ' ', |
|
||||||
viewBtnIcon: ' ', |
|
||||||
delBtnIcon: ' ', |
|
||||||
editBtnIcon: ' ', |
|
||||||
searchShowBtn: false, |
|
||||||
align: 'center', |
|
||||||
column: [ |
|
||||||
{ |
|
||||||
label: '工序号', |
|
||||||
prop: 'processNo', |
|
||||||
span: 23, |
|
||||||
cell: true, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '工序', |
|
||||||
prop: 'bsProcedureSet.ppsId', |
|
||||||
bind: 'bsProcedureSet.ppsId', |
|
||||||
cell: true, |
|
||||||
span: 23, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '工序代码', |
|
||||||
prop: 'bsProcedureSet.ppsCode', |
|
||||||
bind: 'bsProcedureSet.ppsCode', |
|
||||||
cell: true, |
|
||||||
span: 23, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '工艺能力', |
|
||||||
prop: 'bsCraftAbility.caId', |
|
||||||
bind: 'bsCraftAbility.caId', |
|
||||||
cell: true, |
|
||||||
span: 23, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '工时定额', |
|
||||||
prop: 'hourQuota', |
|
||||||
cell: true, |
|
||||||
span: 23, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '工序描述', |
|
||||||
prop: 'memo', |
|
||||||
cell: true, |
|
||||||
span: 23, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
{ |
|
||||||
label: '主工序', |
|
||||||
prop: 'cruxProcess', |
|
||||||
cell: true, |
|
||||||
span: 23, |
|
||||||
rules: [ |
|
||||||
{ |
|
||||||
required: true, |
|
||||||
message: '请输入密码', |
|
||||||
trigger: 'blur', |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
], |
|
||||||
}, |
|
||||||
}; |
|
||||||
}, |
|
||||||
watch: { |
|
||||||
activeName: function () { |
|
||||||
this.loadDetail(); |
|
||||||
}, |
|
||||||
}, |
|
||||||
mounted() { |
|
||||||
this.$refs.form.resetFields(); |
|
||||||
this.craftId = null; |
|
||||||
this.dsCraftMold = { |
|
||||||
qualityGrade: [], |
|
||||||
quGrText: [], |
|
||||||
dsPart: { partId: this.partId }, |
|
||||||
priority: 3, |
|
||||||
craftNo: 'C000000', |
|
||||||
rank: 2, |
|
||||||
}; |
|
||||||
this.$refs.processRef.processList = []; |
|
||||||
|
|
||||||
this.disabled = this.dialogType == 'view' ? true : false; |
|
||||||
|
|
||||||
this.getPartDetails() |
|
||||||
}, |
|
||||||
methods: { |
|
||||||
// 获取零件信息详情数据 |
|
||||||
getPartDetails() { |
|
||||||
getProcessManagementAuthorized(this.partId).then(res => { |
|
||||||
this.formData = res.data.data.dsPartEntity; |
|
||||||
this.data = res.data.data.dsPartEntities |
|
||||||
if (res.data.data.dsPartEntity.isGlassCake === '0') { |
|
||||||
this.formData.isGlassCake = false; |
|
||||||
} else { |
|
||||||
this.formData.isGlassCake = true; |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
|
|
||||||
|
|
||||||
refreshLoad() { |
|
||||||
this.$refs.processRef.processList = []; |
|
||||||
}, |
|
||||||
procedureQuaChange(idList, item) { |
|
||||||
const list = this.procedureQuaList.concat(item); |
|
||||||
this.procedureQuaList = this.$removedup(list, 'pqId'); |
|
||||||
this.dsCraftMold.quGrText = []; |
|
||||||
idList.forEach(idItem => { |
|
||||||
this.procedureQuaList.forEach((item, index) => { |
|
||||||
if (item.pqId === idItem) { |
|
||||||
this.dsCraftMold.quGrText.push(item.pqName); |
|
||||||
} |
|
||||||
}); |
|
||||||
}); |
|
||||||
}, |
|
||||||
loadData(craftId) { |
|
||||||
if (!craftId) return; |
|
||||||
this.craftId = craftId; |
|
||||||
this.loadDetail(); |
|
||||||
this.$ajax.get('dsCraft/getByKey/' + craftId).then(res => { |
|
||||||
this.dsCraftMold = res.data; |
|
||||||
if (!this.dsCraftMold.qualityGrade) { |
|
||||||
this.dsCraftMold.qualityGrade = []; |
|
||||||
this.procedureQuaOption = []; |
|
||||||
} else { |
|
||||||
this.dsCraftMold.qualityGrade = JSON.parse(this.dsCraftMold.qualityGrade); |
|
||||||
this.dsCraftMold.quGrText = JSON.parse(this.dsCraftMold.quGrText); |
|
||||||
this.procedureQuaOption = []; |
|
||||||
this.dsCraftMold.quGrText.forEach((item, index) => { |
|
||||||
this.procedureQuaOption.push({ |
|
||||||
pqId: this.dsCraftMold.qualityGrade[index], |
|
||||||
pqName: item, |
|
||||||
}); |
|
||||||
}); |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
addRefresh() { |
|
||||||
this.$refs.form.resetFields(); |
|
||||||
this.craftId = null; |
|
||||||
this.dsCraftMold = { |
|
||||||
qualityGrade: [], |
|
||||||
quGrText: [], |
|
||||||
dsPart: { partId: this.partId }, |
|
||||||
priority: 3, |
|
||||||
craftNo: 'C000000', |
|
||||||
rank: 2, |
|
||||||
}; |
|
||||||
this.$refs.processRef.processList = []; |
|
||||||
}, |
|
||||||
validateForm() { |
|
||||||
this.$refs.form.validate(valid => { |
|
||||||
if (valid) { |
|
||||||
if (this.activeName === '1') { |
|
||||||
this.$refs.processRef.submit(); |
|
||||||
} else if (this.activeName === '2') { |
|
||||||
this.$refs.platedQuotaRef.submit(); |
|
||||||
} |
|
||||||
} |
|
||||||
}); |
|
||||||
}, |
|
||||||
loadDetail() { |
|
||||||
if (this.activeName === '1') { |
|
||||||
this.$refs.processRef.loadData(this.craftId); |
|
||||||
} else if (this.activeName === '2') { |
|
||||||
this.$refs.platedQuotaRef.loadData(this.craftId); |
|
||||||
} |
|
||||||
}, |
|
||||||
queryTree(isCall, craftId) { |
|
||||||
this.$emit('queryTree'); |
|
||||||
if (isCall) { |
|
||||||
this.loadData(craftId); |
|
||||||
} |
|
||||||
}, |
|
||||||
}, |
|
||||||
}; |
|
||||||
</script> |
|
||||||
<style lang="scss" scoped> |
|
||||||
// .vd-form /deep/ .el-input { |
|
||||||
// width: 190px !important; |
|
||||||
// } |
|
||||||
// .vd-form /deep/ .el-form-item--mini.el-form-item, |
|
||||||
// .el-form-item--small.el-form-item { |
|
||||||
// margin-bottom: 4px; |
|
||||||
// } |
|
||||||
</style> |
|
||||||
Loading…
Reference in new issue