|
|
|
@ -95,12 +95,15 @@ |
|
|
|
<el-form-item :label="'物料名称'" prop="partDesc" :rules="rules.partDesc"> |
|
|
|
<el-input v-model="modalData.partDesc" disabled style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'物料单位'"> |
|
|
|
<el-input v-model="modalData.printUnitName" disabled style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'制造类型'" prop="bomType" :rules="rules.bomType"> |
|
|
|
<el-select v-model="modalData.bomType" :disabled="modalDisableFlag" style="width: 221px"> |
|
|
|
<el-select v-model="modalData.bomType" @change="bomTypeChange" :disabled="modalDisableFlag" style="width: 221px"> |
|
|
|
<el-option label="Manufacturing" value="Manufacturing"></el-option> |
|
|
|
<el-option label="ManufacturedRecipe" value="ManufacturedRecipe"></el-option> |
|
|
|
<el-option label="PurchaseRaw" value="PurchaseRaw"></el-option> |
|
|
|
<el-option label="Purchased" value="Purchased"></el-option> |
|
|
|
<el-option label="Repair" value="Repair"></el-option> |
|
|
|
<el-option label="Purchase" value="Purchase"></el-option> |
|
|
|
<el-option label="Prototype" value="Prototype"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item :label="'类型'" prop="typeFlag" :rules="rules.typeFlag">--> |
|
|
|
@ -110,7 +113,7 @@ |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<el-form-item :label="'净重'"> |
|
|
|
<el-input class="numInput" v-model="modalData.netWeight" type="number" @input="handleInput(modalData.netWeight,1)" style="width: 221px"></el-input> |
|
|
|
<el-input class="numInput" v-model="modalData.netWeight" type="number" @input="handleInput(modalData.netWeight,1)" style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
@ -135,7 +138,7 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'BOM版本号'" prop="engChgLevel" :rules="rules.engChgLevel"> |
|
|
|
<el-input v-model="modalData.engChgLevel" type="number" :disabled="modalDisableFlag" style="width: 221px"></el-input> |
|
|
|
<el-input v-model="modalData.engChgLevel" type="number" disabled style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'工程版本号'"> |
|
|
|
<el-input v-model="modalData.engRevision" style="width: 221px"></el-input> |
|
|
|
@ -277,7 +280,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 物料模态框 --> |
|
|
|
<el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="520px"> |
|
|
|
<el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="900px"> |
|
|
|
<div class="rq"> |
|
|
|
<el-form :inline="true" label-position="top" :model="partData"> |
|
|
|
<el-form-item :label="'物料编码'"> |
|
|
|
@ -319,7 +322,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 子明细物料模态框 --> |
|
|
|
<el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="520px"> |
|
|
|
<el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="700px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentPartData"> |
|
|
|
<el-form-item :label="'物料编码'"> |
|
|
|
<el-input v-model="componentPartData.partNo" clearable style="width: 120px"></el-input> |
|
|
|
@ -332,7 +335,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="300" |
|
|
|
:height="250" |
|
|
|
:data="componentPartList" |
|
|
|
@row-dblclick="getComponentRowData" |
|
|
|
border |
|
|
|
@ -353,59 +356,58 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:35px;margin-top:10px;text-align:center"> |
|
|
|
<el-button type="primary" @click="componentPartModelFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 子明细新增模态框 --> |
|
|
|
<el-dialog title="新增子物料" :close-on-click-modal="false" v-drag :visible.sync="componentSaveModal" width="500px"> |
|
|
|
<el-dialog title="新增子物料" :close-on-click-modal="false" v-drag :visible.sync="componentSaveModal" width="800px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'序号'" prop="lineSequence" :rules="componentRules.lineSequence"> |
|
|
|
<el-input class="numInput" v-model="componentData.lineSequence" type="number" style="width: 49px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="componentPart" :rules="componentRules.componentPart"> |
|
|
|
<span v-if="!componentDisableFlag" slot="label" @click="queryComponentPartList()"><a herf="#">子物料编码</a></span> |
|
|
|
<span v-if="componentDisableFlag" slot="label">子物料编码</span> |
|
|
|
<el-input v-model="componentData.componentPart" :disabled="componentDisableFlag" style="width: 221px"></el-input> |
|
|
|
<el-input v-model="componentData.componentPart" :disabled="componentDisableFlag" style="width: 175px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'子物料名称'"> |
|
|
|
<el-input v-model="componentData.componentPartDesc" disabled style="width: 327px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'子物料名称'" prop="componentPartDesc" :rules="componentRules.componentPartDesc"> |
|
|
|
<el-input v-model="componentData.componentPartDesc" disabled style="width: 221px"></el-input> |
|
|
|
<el-form-item :label="'单位'"> |
|
|
|
<el-input v-model="componentData.printUnitName" disabled style="width: 165px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'单位用量'" prop="qtyPerAssembly" :rules="componentRules.qtyPerAssembly"> |
|
|
|
<el-input class="numInput" v-model="componentData.qtyPerAssembly" @input="handleInput(componentData.qtyPerAssembly,4)" type="number" style="width: 142px"></el-input> |
|
|
|
<el-input class="numInput" v-model="componentData.qtyPerAssembly" @input="handleInput16(componentData.qtyPerAssembly,1)" type="number" style="width: 144px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'调机量'" prop="componentScrap" :rules="componentRules.componentScrap"> |
|
|
|
<el-input class="numInput" v-model="componentData.componentScrap" @input="handleInput(componentData.componentScrap,5)" type="number" style="width: 142px"></el-input> |
|
|
|
<el-input class="numInput" v-model="componentData.componentScrap" @input="handleInput(componentData.componentScrap,5)" type="number" style="width: 80px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'损耗率%'" prop="shrinkageFactor" :rules="componentRules.shrinkageFactor"> |
|
|
|
<el-input class="numInput" v-model="componentData.shrinkageFactor" @input="handleInputB(componentData.shrinkageFactor)" type="number" style="width: 142px"></el-input> |
|
|
|
<el-input class="numInput" v-model="componentData.shrinkageFactor" @input="handleInputB(componentData.shrinkageFactor)" type="number" style="width: 80px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'单位'"> |
|
|
|
<el-input v-model="componentData.printUnitName" disabled style="width: 142px"></el-input> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label" @click="queryOperationList()"><a>工序</a></span> |
|
|
|
<el-input v-model="componentData.operationName" style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'排序'"> |
|
|
|
<el-input v-model="componentData.lineSequence" type="number" style="width: 142px"></el-input> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label" @click="getBaseList(117)"><a herf="#">发料库位</a></span> |
|
|
|
<el-input v-model="componentData.issueToLocName" style="width: 110px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'生产属性'" prop="issueType" :rules="componentRules.issueType"> |
|
|
|
<el-select v-model="componentData.issueType" clearable style="width: 142px"> |
|
|
|
<el-option label="ReserveAndBackflush" value="ReserveAndBackflush"></el-option> |
|
|
|
<el-select v-model="componentData.issueType" style="width: 165px"> |
|
|
|
<el-option label="Reserve and Backflush" value="Reserve and Backflush"></el-option> |
|
|
|
<el-option label="Reserve" value="Reserve"></el-option> |
|
|
|
<el-option label="Backflush" value="Backflush"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px"> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label" @click="queryOperationList()"><a>工序</a></span> |
|
|
|
<el-input v-model="componentData.operationName" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label" @click="getBaseList(117)"><a herf="#">发料库位</a></span> |
|
|
|
<el-input v-model="componentData.issueToLocName" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px"> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input type="textarea" v-model="componentData.noteText" :rows="3" resize='none' show-word-limit style="width: 455px;height: 20px"></el-input> |
|
|
|
<el-input type="textarea" v-model="componentData.noteText" :rows="3" resize='none' show-word-limit style="width: 759px;height: 20px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:35px;margin-top:65px;text-align:center"> |
|
|
|
@ -477,6 +479,8 @@ import { |
|
|
|
updateBomComponent, // 修改bom子明细 |
|
|
|
deleteBomComponent, // 删除bom子明细 |
|
|
|
queryOperationList, // 根据物料编码查询工序 |
|
|
|
getBomEngChgLevel, // 获取物料的bom版本号 |
|
|
|
getComponentLineSequence, // 获取子料的序号 |
|
|
|
} from '@/api/part/bomManagement.js' |
|
|
|
import ChooseList from '@/views/modules/common/Chooselist' |
|
|
|
import dayjs from "dayjs"; |
|
|
|
@ -553,7 +557,9 @@ export default { |
|
|
|
createDate: '', |
|
|
|
createBy: '', |
|
|
|
updateDate: '', |
|
|
|
updateBy: '' |
|
|
|
updateBy: '', |
|
|
|
printUnit: '', |
|
|
|
printUnitName: '', |
|
|
|
}, |
|
|
|
detailData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
@ -882,6 +888,30 @@ export default { |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'spec', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '规格型号', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'printUnitName', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '计量单位', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
], |
|
|
|
componentPartColumnList: [ |
|
|
|
{ |
|
|
|
@ -907,7 +937,31 @@ export default { |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'spec', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '规格型号', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
{ |
|
|
|
columnProp: 'printUnitName', |
|
|
|
headerAlign: "center", |
|
|
|
align: "center", |
|
|
|
columnLabel: '计量单位', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
sortLv: 0, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
}, |
|
|
|
], |
|
|
|
columnSubDetailList: [ |
|
|
|
{ |
|
|
|
@ -919,7 +973,7 @@ export default { |
|
|
|
columnProp: 'lineSequence', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '排序', |
|
|
|
columnLabel: '序号', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
@ -1199,7 +1253,7 @@ export default { |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
componentPartDesc: [ |
|
|
|
lineSequence: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
@ -1368,7 +1422,9 @@ export default { |
|
|
|
engRevision: '', |
|
|
|
typeFlag: 'B', |
|
|
|
netWeight: 0, |
|
|
|
createBy: this.$store.state.user.name |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
printUnit: '', |
|
|
|
printUnitName: '', |
|
|
|
} |
|
|
|
this.detailData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
@ -1407,8 +1463,11 @@ export default { |
|
|
|
engRevision: row.engRevision, |
|
|
|
typeFlag: row.typeFlag, |
|
|
|
netWeight: row.netWeight, |
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
printUnit: row.printUnit, |
|
|
|
printUnitName: row.printUnitName, |
|
|
|
} |
|
|
|
console.log(row) |
|
|
|
// 查bom明细 |
|
|
|
queryBomDetail(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -1542,7 +1601,7 @@ export default { |
|
|
|
printUnitName: '', |
|
|
|
qtyPerAssembly: 0, |
|
|
|
componentScrap: 0, |
|
|
|
issueType: 'ReserveAndBackflush', |
|
|
|
issueType: 'Reserve and Backflush', |
|
|
|
shrinkageFactor: 0, |
|
|
|
lineItemNo: '', |
|
|
|
operationName: '', |
|
|
|
@ -1552,6 +1611,16 @@ export default { |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
lineSequence: '' |
|
|
|
} |
|
|
|
// 获取子料的序号 |
|
|
|
getComponentLineSequence(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.componentData.lineSequence = data.lineSequence |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.componentDisableFlag = false |
|
|
|
this.componentSaveModal = true |
|
|
|
}, |
|
|
|
@ -1772,7 +1841,7 @@ export default { |
|
|
|
* bom删除 |
|
|
|
*/ |
|
|
|
delModal () { |
|
|
|
if(this.bomSelections.length === 0){ |
|
|
|
if (this.bomSelections.length === 0) { |
|
|
|
this.$message.warning('请勾选要删除的BOM!') |
|
|
|
return |
|
|
|
} |
|
|
|
@ -1825,8 +1894,35 @@ export default { |
|
|
|
getRowData (row) { |
|
|
|
this.modalData.partNo = row.partNo |
|
|
|
this.modalData.partDesc = row.partDesc |
|
|
|
this.partModelFlag = false |
|
|
|
this.modalData.printUnit = row.printUnit |
|
|
|
this.modalData.printUnitName = row.printUnitName |
|
|
|
// 获取物料的bom版本号 |
|
|
|
getBomEngChgLevel(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.modalData.engChgLevel = data.engChgLevel |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.partModelFlag = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// bom类型改变 |
|
|
|
bomTypeChange () { |
|
|
|
// 获取物料的bom版本号 |
|
|
|
getBomEngChgLevel(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.modalData.engChgLevel = data.engChgLevel |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 双击选中工序 |
|
|
|
* @param row |
|
|
|
@ -1937,6 +2033,10 @@ export default { |
|
|
|
* 新增子明细方法 |
|
|
|
*/ |
|
|
|
componentDataSave () { |
|
|
|
if (this.componentData.lineSequence === '' || this.componentData.lineSequence == null) { |
|
|
|
this.$message.warning('序号不能为空!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.partNo === '' || this.componentData.partNo == null) { |
|
|
|
this.$message.warning('请选择主记录物料编码!') |
|
|
|
return |
|
|
|
@ -2286,7 +2386,7 @@ export default { |
|
|
|
handleInput (value, type) { |
|
|
|
// 大于等于0,且只能输入4位小数 |
|
|
|
let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1') |
|
|
|
if (val == null || val == undefined || val == '') { |
|
|
|
if (val === null || val === undefined || val === '') { |
|
|
|
val = 0 |
|
|
|
} |
|
|
|
if (type === 1) { |
|
|
|
@ -2295,12 +2395,26 @@ export default { |
|
|
|
this.detailData.minLotQty = val |
|
|
|
} else if (type === 3) { |
|
|
|
this.saveDetailData.minLotQty = val |
|
|
|
} else if (type === 4) { |
|
|
|
this.componentData.qtyPerAssembly = val |
|
|
|
} else if (type === 5) { |
|
|
|
} |
|
|
|
// else if (type === 4) { |
|
|
|
// this.componentData.qtyPerAssembly = val |
|
|
|
// } |
|
|
|
else if (type === 5) { |
|
|
|
this.componentData.componentScrap = val |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleInput16 (value, type) { |
|
|
|
// 大于等于0,且只能输入4位小数 |
|
|
|
let val = value.replace(/^\D*([0-9]\d*\.?\d{0,16})?.*$/,'$1') |
|
|
|
if (val === null || val === undefined || val === '') { |
|
|
|
val = 0 |
|
|
|
} |
|
|
|
if (type === 1) { |
|
|
|
this.componentData.qtyPerAssembly = val |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleInputB (value) { |
|
|
|
// 0-100 |
|
|
|
const reg = /^(([1-9]?\d{0,1}(\.\d{1,2})?)|100|100\.(0){1,2})$/ |
|
|
|
|