|
@@ -110,10 +110,14 @@
|
|
|
<!-- </el-col>-->
|
|
<!-- </el-col>-->
|
|
|
<!-- </el-row>-->
|
|
<!-- </el-row>-->
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <el-form-item label="关联物料" prop="materialId">
|
|
|
|
|
- <el-input v-model="dataForm.materialId" :disabled="display" placeholder="请选择物料"></el-input>
|
|
|
|
|
- <el-button @click="selectMaterial">选择</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="关联物料" prop="materialCode">
|
|
|
|
|
+ <el-input v-model.lazy="material.materialCode" disabled placeholder="请选择物料"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8" style="margin-left: 20px">
|
|
|
|
|
+ <el-button @click="selectMaterial" type="primary">选择</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col>
|
|
<el-col>
|
|
@@ -122,13 +126,6 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-<!-- <el-row>-->
|
|
|
|
|
-<!-- <el-col>-->
|
|
|
|
|
-<!-- <el-form-item label="关重件" prop="importance">-->
|
|
|
|
|
-<!-- <el-input v-model="dataForm.importance" :disabled="display" placeholder="" type="textarea"></el-input>-->
|
|
|
|
|
-<!-- </el-form-item>-->
|
|
|
|
|
-<!-- </el-col>-->
|
|
|
|
|
-<!-- </el-row>-->
|
|
|
|
|
<el-row class="my-row">
|
|
<el-row class="my-row">
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="简图" prop="attachList2">
|
|
<el-form-item label="简图" prop="attachList2">
|
|
@@ -213,8 +210,8 @@
|
|
|
</span>
|
|
</span>
|
|
|
<!-- </el-dialog> -->
|
|
<!-- </el-dialog> -->
|
|
|
<template-chose v-if="productListVisible" ref="productList" @addItems="addProductItems" />
|
|
<template-chose v-if="productListVisible" ref="productList" @addItems="addProductItems" />
|
|
|
- <templateChoseMaterial v-if="materialListVisible" ref="materialList" @addItems="addMaterialItems" />
|
|
|
|
|
<template-draw-choose v-if="drawListVisible" ref="drawList" @addItems="addDrawItems" />
|
|
<template-draw-choose v-if="drawListVisible" ref="drawList" @addItems="addDrawItems" />
|
|
|
|
|
+ <stock-dialog v-if="materialCompVisible" ref="stockList" @addItem="addStockItem"/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -229,24 +226,19 @@ import { dealStepData, dealStepLogs } from '@/api/util'
|
|
|
import CusComponent from '../common/cus-component'
|
|
import CusComponent from '../common/cus-component'
|
|
|
import DrawComponents from '../common/draw-components'
|
|
import DrawComponents from '../common/draw-components'
|
|
|
import DocComponents from '../common/doc-components'
|
|
import DocComponents from '../common/doc-components'
|
|
|
|
|
+import stockDialog from '../warehouse/stock-dialog.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'product-add-or-update',
|
|
name: 'product-add-or-update',
|
|
|
- components: { DocComponents, DrawComponents, CusComponent, UploadComponent, templateChose, templateChoseMaterial, templateDrawChoose },
|
|
|
|
|
|
|
+ components: { DocComponents, DrawComponents, CusComponent, UploadComponent, templateChose, templateChoseMaterial, templateDrawChoose, stockDialog },
|
|
|
computed: {
|
|
computed: {
|
|
|
orgId: {
|
|
orgId: {
|
|
|
get () { return this.$store.state.user.orgId }
|
|
get () { return this.$store.state.user.orgId }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // watch: {
|
|
|
|
|
- // 'dataForm.isCompose' (value) {
|
|
|
|
|
- // this.dataForm.displayProductList = value === '1'
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
productListVisible: false,
|
|
productListVisible: false,
|
|
|
- materialListVisible: false,
|
|
|
|
|
drawListVisible: false,
|
|
drawListVisible: false,
|
|
|
materialCompVisible: false,
|
|
materialCompVisible: false,
|
|
|
visible: false,
|
|
visible: false,
|
|
@@ -256,13 +248,17 @@ export default {
|
|
|
{code: '1', value: '是'},
|
|
{code: '1', value: '是'},
|
|
|
{code: '0', value: '否'}
|
|
{code: '0', value: '否'}
|
|
|
],
|
|
],
|
|
|
- // optionsTech: [],
|
|
|
|
|
fileList: [],
|
|
fileList: [],
|
|
|
listingList: [],
|
|
listingList: [],
|
|
|
dataList: [],
|
|
dataList: [],
|
|
|
id: 0,
|
|
id: 0,
|
|
|
productDetails: [],
|
|
productDetails: [],
|
|
|
materialList: [],
|
|
materialList: [],
|
|
|
|
|
+ // 对应物料
|
|
|
|
|
+ material: {
|
|
|
|
|
+ 'materialId': 0,
|
|
|
|
|
+ 'materialCode': ''
|
|
|
|
|
+ },
|
|
|
drawingList: [],
|
|
drawingList: [],
|
|
|
displayProductList: false,
|
|
displayProductList: false,
|
|
|
dataForm: {
|
|
dataForm: {
|
|
@@ -349,15 +345,18 @@ export default {
|
|
|
|
|
|
|
|
// 物料图纸
|
|
// 物料图纸
|
|
|
this.drawingList = data.data.proDrawings || []
|
|
this.drawingList = data.data.proDrawings || []
|
|
|
|
|
+
|
|
|
|
|
+ // 关联物料
|
|
|
|
|
+ this.material = {
|
|
|
|
|
+ materialId: data.data.materialId,
|
|
|
|
|
+ materialCode: data.data.materialCode
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
uploadSuccess (fileList) {
|
|
uploadSuccess (fileList) {
|
|
|
this.fileList = fileList
|
|
this.fileList = fileList
|
|
|
},
|
|
},
|
|
|
- uploadSuccess2 (fileList2) {
|
|
|
|
|
- this.listingList = fileList2
|
|
|
|
|
- },
|
|
|
|
|
// 添加组合物料
|
|
// 添加组合物料
|
|
|
addProduct () {
|
|
addProduct () {
|
|
|
this.productListVisible = true
|
|
this.productListVisible = true
|
|
@@ -382,24 +381,6 @@ export default {
|
|
|
deleteProductHandle (productId) {
|
|
deleteProductHandle (productId) {
|
|
|
this.productDetails.splice(this.productDetails.findIndex((item) => item.productId === productId), 1)
|
|
this.productDetails.splice(this.productDetails.findIndex((item) => item.productId === productId), 1)
|
|
|
},
|
|
},
|
|
|
- addMaterial () {
|
|
|
|
|
- this.materialListVisible = true
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.$refs.materialList.init()
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- addMaterialItems (items) {
|
|
|
|
|
- this.materialList = []
|
|
|
|
|
- items.forEach((item) => {
|
|
|
|
|
- this.addMaterialItem(item)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- addMaterialItem (item) {
|
|
|
|
|
- this.materialList.push({
|
|
|
|
|
- ...item,
|
|
|
|
|
- cnt: 0
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
validateField (type) {
|
|
validateField (type) {
|
|
|
this.$refs.dataForm.validateField(type)
|
|
this.$refs.dataForm.validateField(type)
|
|
|
},
|
|
},
|
|
@@ -407,6 +388,11 @@ export default {
|
|
|
dataFormSubmit () {
|
|
dataFormSubmit () {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
|
+ // 对应物料
|
|
|
|
|
+ if (this.material || this.material.materialId !== 0) {
|
|
|
|
|
+ this.dataForm.materialId = this.material.materialId
|
|
|
|
|
+ this.dataForm.materialCode = this.material.materialCode
|
|
|
|
|
+ }
|
|
|
// 组合小物料
|
|
// 组合小物料
|
|
|
this.dataForm.childrenIdList = []
|
|
this.dataForm.childrenIdList = []
|
|
|
const b1 = this.displayProductList
|
|
const b1 = this.displayProductList
|
|
@@ -441,11 +427,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- docSelectChange (val) {
|
|
|
|
|
- // console.log(val)
|
|
|
|
|
- this.dataForm.docIdList = val
|
|
|
|
|
- },
|
|
|
|
|
- // 添加关联图纸
|
|
|
|
|
|
|
+// 添加关联图纸
|
|
|
addDrawingList () {
|
|
addDrawingList () {
|
|
|
this.drawListVisible = true
|
|
this.drawListVisible = true
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -472,9 +454,13 @@ export default {
|
|
|
// 选择物料
|
|
// 选择物料
|
|
|
selectMaterial () {
|
|
selectMaterial () {
|
|
|
this.materialCompVisible = true
|
|
this.materialCompVisible = true
|
|
|
- // this.$nextTick(() => {
|
|
|
|
|
- // this.$refs.materialComp.init()
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.stockList.init()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 添加物料到 dataForm
|
|
|
|
|
+ addStockItem (item) {
|
|
|
|
|
+ this.material = item
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|