|
|
|
@ -1191,6 +1191,7 @@ import ChooseList from '@/views/modules/common/Chooselist' |
|
|
|
import {isAuth} from "../../../utils"; |
|
|
|
import FilterSearch from "../../common/filterSearch.vue"; |
|
|
|
import {partAllInfoSearchAny} from "../../../api/part/partAllInfoSearch"; |
|
|
|
import {partInformationSearch} from "@/api/part/partInformation"; |
|
|
|
import { |
|
|
|
bomManagementSearchAny, |
|
|
|
queryComponentPartRecipeList, |
|
|
|
@ -4720,61 +4721,65 @@ export default { |
|
|
|
this.$message.warning('请选择生产属性!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.saveComponentLoading = true |
|
|
|
if (this.componentData.flag === '1') { |
|
|
|
saveBomComponent(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
this.byProductList = data.rows.byProductList |
|
|
|
this.manufStructCostDistribList = data.rows.manufStructCostDistribList |
|
|
|
if (isClose) { |
|
|
|
if (this.subDetailTable === 'by_products') { |
|
|
|
this.saveByProductModal() |
|
|
|
|
|
|
|
const doSaveBomComponent = () => { |
|
|
|
this.saveComponentLoading = true |
|
|
|
if (this.componentData.flag === '1') { |
|
|
|
saveBomComponent(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
this.byProductList = data.rows.byProductList |
|
|
|
this.manufStructCostDistribList = data.rows.manufStructCostDistribList |
|
|
|
if (isClose) { |
|
|
|
if (this.subDetailTable === 'by_products') { |
|
|
|
this.saveByProductModal() |
|
|
|
} else { |
|
|
|
this.saveComponentModal() |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.saveComponentModal() |
|
|
|
this.componentSaveModal = false |
|
|
|
} |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) |
|
|
|
} else { |
|
|
|
this.componentSaveModal = false |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(()=>{ |
|
|
|
this.saveComponentLoading = false |
|
|
|
}) |
|
|
|
} else if (this.componentData.flag === '2') { |
|
|
|
updateBomComponent(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
this.byProductList = data.rows.byProductList |
|
|
|
this.componentSaveModal = false |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
}) |
|
|
|
} else if (this.componentData.flag === '2') { |
|
|
|
updateBomComponent(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows.subDetailList |
|
|
|
this.byProductList = data.rows.byProductList |
|
|
|
this.componentSaveModal = false |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$message({ message: '操作成功', type: 'success', duration: 1500, onClose: () => {} }) |
|
|
|
} else { |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.saveComponentLoading = false |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(()=>{ |
|
|
|
this.saveComponentLoading = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
partInformationSearch({ |
|
|
|
site: this.$store.state.user.site, |
|
|
|
ifsPartNo: this.componentData.componentPart, |
|
|
|
limit: 1, |
|
|
|
page: 1 |
|
|
|
}).then(({data}) => { |
|
|
|
if (data && data.code === 0 && data.page.list.length > 0 && data.page.list[0].drawingNo) { |
|
|
|
doSaveBomComponent() |
|
|
|
} else { |
|
|
|
this.$message.warning('子物料【' + this.componentData.componentPart + '】未获取编码,不能保存!') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('验证子物料编码信息失败,请重试!') |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 编辑副产品成本分配方法 |
|
|
|
|