|
|
@@ -134,23 +134,19 @@
|
|
|
<!-- 分类选择弹窗 -->
|
|
|
<CategoryDialog ref="categoryRefs" @chooseCategory='confirmCategory'/>
|
|
|
<!-- 仓储配置 -->
|
|
|
- <WarehouseInfo ref="warehouseRefs" :form="form"/>
|
|
|
- <!-- 采购 -->
|
|
|
- <ProcureInfo ref="procureRefs" :form="form"/>
|
|
|
+ <WarehouseInfo ref="warehouseRefs" :form="categoryWms"/>
|
|
|
<!-- 生产信息 -->
|
|
|
- <ProductionInfo ref="productionRefs" :form="form"/>
|
|
|
+ <ProductionInfo ref="productionRefs" :form="categoryMes"/>
|
|
|
<!-- 计划 -->
|
|
|
- <PlanInfo ref="planRefs" :form="form"/>
|
|
|
- <!-- 销售信息 -->
|
|
|
- <SalesInfo ref="salesRefs" :form="form"/>
|
|
|
+ <PlanInfo ref="planRefs" :form="categoryAps"/>
|
|
|
<!-- 质量配置 -->
|
|
|
- <QualityInfo ref="qualityRefs" :form="form"/>
|
|
|
+ <QualityInfo ref="qualityRefs" :form="categoryQms"/>
|
|
|
<!-- 舟皿信息 -->
|
|
|
- <BoatInfo ref="qualityRefs" :form="form"/>
|
|
|
+ <BoatInfo ref="qualityRefs" :form="categoryPallet"/>
|
|
|
<!-- 周转车信息 -->
|
|
|
- <TurnoverInfo ref="turnoverRefs" :form="form"/>
|
|
|
+ <TurnoverInfo ref="turnoverRefs" :form="categoryVehicle"/>
|
|
|
<!-- 模具信息 -->
|
|
|
- <MoldInfo ref="moldRefs" :form="form"/>
|
|
|
+ <MoldInfo ref="moldRefs" :form="categoryMold"/>
|
|
|
<!-- 备注信息 -->
|
|
|
<RemarkInfo ref="remarkRefs" :form="remarkform"/>
|
|
|
</div>
|
|
|
@@ -160,10 +156,10 @@
|
|
|
import GroupDialog from './components/GroupDialog.vue';
|
|
|
import CategoryDialog from './components/CategoryDialog.vue';
|
|
|
import WarehouseInfo from './components/WarehouseInfo.vue';
|
|
|
- import ProcureInfo from './components/ProcureInfo.vue';
|
|
|
+ // import ProcureInfo from './components/ProcureInfo.vue';
|
|
|
import ProductionInfo from './components/ProductionInfo.vue';
|
|
|
import PlanInfo from './components/PlanInfo.vue';
|
|
|
- import SalesInfo from './components/SalesInfo.vue';
|
|
|
+ // import SalesInfo from './components/SalesInfo.vue';
|
|
|
import QualityInfo from './components/QualityInfo.vue';
|
|
|
import BoatInfo from './components/BoatInfo.vue';
|
|
|
import TurnoverInfo from './components/TurnoverInfo.vue';
|
|
|
@@ -177,8 +173,8 @@
|
|
|
export default {
|
|
|
name: 'ManageMaterial',
|
|
|
components: {
|
|
|
- GroupDialog , deptSelect , personSelect , WarehouseInfo , ProcureInfo ,ProductionInfo ,
|
|
|
- PlanInfo , SalesInfo , QualityInfo , BoatInfo , TurnoverInfo , MoldInfo , RemarkInfo , CategoryDialog
|
|
|
+ GroupDialog , deptSelect , personSelect , WarehouseInfo , ProductionInfo ,
|
|
|
+ PlanInfo , QualityInfo , BoatInfo , TurnoverInfo , MoldInfo , RemarkInfo , CategoryDialog
|
|
|
},
|
|
|
data() {
|
|
|
const defaultForm = {
|
|
|
@@ -188,9 +184,16 @@
|
|
|
return {
|
|
|
loading:false,
|
|
|
form:{...defaultForm},
|
|
|
+ categoryAps:{},
|
|
|
+ categoryMes:{},
|
|
|
+ categoryMold:{},
|
|
|
+ categoryPallet:{},
|
|
|
+ categoryQms:{},
|
|
|
+ categoryVehicle:{},
|
|
|
remarkform:{
|
|
|
remarkAttach:[]
|
|
|
},
|
|
|
+ categoryWms:{},
|
|
|
chooseItem:null,
|
|
|
PathInfo:{},
|
|
|
titileStatus:1
|
|
|
@@ -230,8 +233,9 @@
|
|
|
getDetailInfo(id).then(res=>{
|
|
|
const info = deepClone(res)
|
|
|
this.form = {
|
|
|
- ...info
|
|
|
+ ...info.category
|
|
|
}
|
|
|
+ this.judgeSet(info)
|
|
|
delete this.form.remarkAttach
|
|
|
delete this.form.remark
|
|
|
// this.$set(this.remarkform,'remarkAttach',info.remarkAttach)
|
|
|
@@ -243,6 +247,46 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 判断字段类型并赋值
|
|
|
+ judgeSet(info){
|
|
|
+ if(typeof info.categoryAps == 'string'){
|
|
|
+ this.categoryAps = {}
|
|
|
+ }else{
|
|
|
+ this.categoryAps = info.categoryAps
|
|
|
+ }
|
|
|
+ if(typeof info.categoryMes == 'string'){
|
|
|
+ this.categoryMes = {}
|
|
|
+ }else{
|
|
|
+ this.categoryMes = info.categoryMes
|
|
|
+ }
|
|
|
+ if(typeof info.categoryMold == 'string'){
|
|
|
+ this.categoryMold = {}
|
|
|
+ }else{
|
|
|
+ this.categoryMold = info.categoryMold
|
|
|
+ }
|
|
|
+ if(typeof info.categoryPallet == 'string'){
|
|
|
+ this.categoryPallet = {}
|
|
|
+ }else{
|
|
|
+ this.categoryPallet = info.categoryPallet
|
|
|
+ }
|
|
|
+ if(typeof info.categoryQms == 'string'){
|
|
|
+ this.categoryQms = {}
|
|
|
+ }else{
|
|
|
+ this.categoryQms = info.categoryQms
|
|
|
+ }
|
|
|
+ if(typeof info.categoryVehicle == 'string'){
|
|
|
+ this.categoryVehicle = {}
|
|
|
+ }else{
|
|
|
+ this.categoryVehicle = info.categoryVehicle
|
|
|
+ }
|
|
|
+ if(typeof info.categoryWms == 'string'){
|
|
|
+ this.categoryWms = {}
|
|
|
+ }else{
|
|
|
+ this.categoryWms = info.categoryWms
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 选择所属部门
|
|
|
searchDeptNodeClick (id, info) {
|
|
|
// 根据部门获取人员
|
|
|
@@ -311,12 +355,21 @@
|
|
|
}
|
|
|
this.loading = true;
|
|
|
const data = {
|
|
|
- ...this.form,
|
|
|
- ...this.remarkform,
|
|
|
- ...this.PathInfo
|
|
|
+ categoryWms:this.categoryWms,
|
|
|
+ categoryAps:this.categoryAps,
|
|
|
+ categoryMes:this.categoryMes,
|
|
|
+ categoryMold:this.categoryMold,
|
|
|
+ categoryPallet:this.categoryPallet,
|
|
|
+ categoryQms:this.categoryQms,
|
|
|
+ categoryVehicle:this.categoryVehicle,
|
|
|
+ category:{
|
|
|
+ ...this.form,
|
|
|
+ ...this.remarkform,
|
|
|
+ ...this.PathInfo
|
|
|
+ }
|
|
|
};
|
|
|
- const saveOrUpdate = this.form.id ? editMaterial : addMaterial;
|
|
|
- saveOrUpdate(data)
|
|
|
+ // const saveOrUpdate = this.form.id ? editMaterial : addMaterial;
|
|
|
+ addMaterial(data)
|
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
|
this.$message.success(msg);
|