|
@@ -15,6 +15,7 @@
|
|
<el-select
|
|
<el-select
|
|
v-model="dataForm.type"
|
|
v-model="dataForm.type"
|
|
remote
|
|
remote
|
|
|
|
+ @change="typeChanged"
|
|
placeholder="请选择">
|
|
placeholder="请选择">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in optionsType"
|
|
v-for="item in optionsType"
|
|
@@ -155,7 +156,6 @@
|
|
width="100"
|
|
width="100"
|
|
label="操作">
|
|
label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button type="text" size="small" @click="updateItemHandle(scope.row)">编辑</el-button>
|
|
|
|
<el-button style="color: red" type="text" size="small" @click="deleteItemHandle(scope.row.recordId)">删除</el-button>
|
|
<el-button style="color: red" type="text" size="small" @click="deleteItemHandle(scope.row.recordId)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -170,6 +170,7 @@
|
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
|
</span>
|
|
</span>
|
|
<add-purchase v-if="addPurchaseVisible" ref="addPurchase" @addItems="addMaterialItems"/>
|
|
<add-purchase v-if="addPurchaseVisible" ref="addPurchase" @addItems="addMaterialItems"/>
|
|
|
|
+ <add-outsource v-if="addOutsourceVisible" ref="addOutsource" @addItems="addMaterialItems"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -178,13 +179,15 @@
|
|
import { getContractDetail } from '@/api/sale'
|
|
import { getContractDetail } from '@/api/sale'
|
|
import SupplierComponent from '../common/supplier-component'
|
|
import SupplierComponent from '../common/supplier-component'
|
|
import AddPurchase from '../purchase/purchase-chose'
|
|
import AddPurchase from '../purchase/purchase-chose'
|
|
|
|
+ import AddOutsource from '../purchase/outsource-chose'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'contract-add-or-update',
|
|
name: 'contract-add-or-update',
|
|
components: {
|
|
components: {
|
|
SupplierComponent,
|
|
SupplierComponent,
|
|
UploadComponent,
|
|
UploadComponent,
|
|
- AddPurchase
|
|
|
|
|
|
+ AddPurchase,
|
|
|
|
+ AddOutsource
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
orgId: {
|
|
orgId: {
|
|
@@ -195,6 +198,7 @@ export default {
|
|
return {
|
|
return {
|
|
id: 0,
|
|
id: 0,
|
|
addPurchaseVisible: false,
|
|
addPurchaseVisible: false,
|
|
|
|
+ addOutsourceVisible: false,
|
|
dataForm: {},
|
|
dataForm: {},
|
|
materialList: [],
|
|
materialList: [],
|
|
optionsPurchaseType: [],
|
|
optionsPurchaseType: [],
|
|
@@ -239,6 +243,17 @@ export default {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ // 采购物品明细
|
|
|
|
+ if (data.data.purchaseDetailList) {
|
|
|
|
+ data.data.purchaseDetailList.forEach((item) => {
|
|
|
|
+ if (!item.recordId) {
|
|
|
|
+ item.recordId = Math.round(Math.random() * 1000000)
|
|
|
|
+ }
|
|
|
|
+ this.materialList.push({
|
|
|
|
+ ...item
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -306,16 +321,11 @@ export default {
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.$refs.addPurchase.init()
|
|
this.$refs.addPurchase.init()
|
|
})
|
|
})
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 编辑项目
|
|
|
|
- updateItemHandle (row) {
|
|
|
|
- if (Number(this.dataForm.type) === 1) {
|
|
|
|
- this.productListVisible = true
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.$refs.addPurchase.init(row)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ } else if (Number(this.dataForm.type) === 2) {}
|
|
|
|
+ this.addOutsourceVisible = true
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.addOutsource.init()
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 删除项目
|
|
// 删除项目
|
|
deleteItemHandle (recordId) {
|
|
deleteItemHandle (recordId) {
|
|
@@ -341,8 +351,15 @@ export default {
|
|
addMaterialItems (items) {
|
|
addMaterialItems (items) {
|
|
this.materialList = []
|
|
this.materialList = []
|
|
items.forEach((item) => {
|
|
items.forEach((item) => {
|
|
- this.addItem(item)
|
|
|
|
|
|
+ if (Number(this.dataForm.type) === 1) {
|
|
|
|
+ this.addItem(item)
|
|
|
|
+ } else if (Number(this.dataForm.type) === 2) {
|
|
|
|
+ this.addItem(item)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ typeChanged (type) {
|
|
|
|
+ this.materialList = []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|