|
@@ -12,12 +12,12 @@
|
|
|
<el-input v-model="dataForm.productName" :disabled="display" placeholder="产品名称"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="产品规格" prop="productSpec">
|
|
|
<el-input v-model="dataForm.productSpec" :disabled="display" placeholder="产品规格"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
+ <el-col :span="8">
|
|
|
<el-form-item label="产品类别" prop="productType">
|
|
|
<el-select
|
|
|
v-model="dataForm.productType"
|
|
@@ -54,18 +54,28 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8" style="padding-left: 20px">
|
|
|
- <el-form-item label="产品工艺" prop="techId">
|
|
|
- <el-input v-if="display" v-model="dataForm.techName" disabled></el-input>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="产品图纸" prop="drawingIdList">
|
|
|
+ <el-upload v-if="display"
|
|
|
+ class="upload-demo"
|
|
|
+ ref="upload"
|
|
|
+ :multiple="true"
|
|
|
+ action="#"
|
|
|
+ accept="image/jpeg,image/gif,image/png"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :file-list="fileList"
|
|
|
+ :auto-upload="false">
|
|
|
+ </el-upload>
|
|
|
<el-select v-else
|
|
|
- v-model="dataForm.techId"
|
|
|
- :disabled="display"
|
|
|
+ v-model="dataForm.drawingIdList"
|
|
|
filterable
|
|
|
- remote
|
|
|
- :remote-method="remoteTech"
|
|
|
- placeholder="请选择">
|
|
|
+ multiple
|
|
|
+ remote
|
|
|
+ :remote-method="remoteDraw"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%">
|
|
|
<el-option
|
|
|
- v-for="item in optionsTech"
|
|
|
+ v-for="item in optionsDraw"
|
|
|
:key="item.code"
|
|
|
:label="item.value"
|
|
|
:value="item.code">
|
|
@@ -74,37 +84,9 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row class="my-row">
|
|
|
- <el-form-item label="产品图纸" prop="drawingIdList">
|
|
|
- <el-upload v-if="display"
|
|
|
- class="upload-demo"
|
|
|
- ref="upload"
|
|
|
- :multiple="true"
|
|
|
- action="#"
|
|
|
- accept="image/jpeg,image/gif,image/png"
|
|
|
- :on-preview="handlePreview"
|
|
|
- :file-list="fileList"
|
|
|
- :auto-upload="false">
|
|
|
- </el-upload>
|
|
|
- <el-select v-else
|
|
|
- v-model="dataForm.drawingIdList"
|
|
|
- filterable
|
|
|
- multiple
|
|
|
- remote
|
|
|
- :remote-method="remoteDraw"
|
|
|
- placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in optionsDraw"
|
|
|
- :key="item.code"
|
|
|
- :label="item.value"
|
|
|
- :value="item.code">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
<el-row class="my-row">
|
|
|
<el-form-item label="备注" prop="notes">
|
|
|
- <el-input v-model="dataForm.notes" :disabled="display" placeholder="备注"></el-input>
|
|
|
+ <el-input type="textarea" v-model="dataForm.notes" :disabled="display"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
<el-row class="my-row">
|
|
@@ -153,12 +135,6 @@
|
|
|
<el-input-number v-model="scope.row.cnt" :disabled="display" :min="1" style="width: 140px;"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="unitName"
|
|
|
- header-align="center"
|
|
|
- align="center"
|
|
|
- label="单位">
|
|
|
- </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="notes"
|
|
|
header-align="center"
|
|
@@ -231,8 +207,8 @@
|
|
|
<el-dialog title="图片预览" :visible.sync="previewVisible" width="50%">
|
|
|
<img :src="previewPath" :alt="previewName" style="width:100%;height:100%" />
|
|
|
</el-dialog>
|
|
|
- <template-chose v-if="productListVisible" ref="productList" @addItem="addProductItem" />
|
|
|
- <templateChoseMaterial v-if="materialListVisible" ref="materialList" @addItem="addMaterialItem"/>
|
|
|
+ <template-chose v-if="productListVisible" ref="productList" @addItems="addProductItems" />
|
|
|
+ <templateChoseMaterial v-if="materialListVisible" ref="materialList" @addItems="addMaterialItems"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -284,7 +260,6 @@
|
|
|
productSpec: [{ required: true, message: '产品规格不能为空', trigger: 'blur' }],
|
|
|
productType: [{ required: true, message: '产品类别不能为空', trigger: 'change' }],
|
|
|
source: [{ required: true, message: '产品来源不能为空', trigger: 'change' }],
|
|
|
- techId: [{ required: true, message: '产品工艺不能为空', trigger: 'change' }],
|
|
|
drawingIdList: [{ required: true, message: '产品图纸不能为空', trigger: 'blur' }]
|
|
|
}
|
|
|
}
|
|
@@ -424,13 +399,18 @@
|
|
|
this.$refs.productList.init()
|
|
|
})
|
|
|
},
|
|
|
+ addProductItems (items) {
|
|
|
+ this.productDetails = []
|
|
|
+ items.forEach((item) => {
|
|
|
+ this.addProductItem(item)
|
|
|
+ })
|
|
|
+ },
|
|
|
addProductItem (item) {
|
|
|
this.productDetails.push({
|
|
|
productId: item.productId,
|
|
|
productName: item.productName,
|
|
|
productSpec: item.productSpec,
|
|
|
cnt: 1,
|
|
|
- unitName: item.unitName,
|
|
|
notes: item.notes
|
|
|
})
|
|
|
},
|
|
@@ -440,6 +420,12 @@
|
|
|
this.$refs.materialList.init()
|
|
|
})
|
|
|
},
|
|
|
+ addMaterialItems (items) {
|
|
|
+ this.materialList = []
|
|
|
+ items.forEach((item) => {
|
|
|
+ this.addMaterialItem(item)
|
|
|
+ })
|
|
|
+ },
|
|
|
addMaterialItem (item) {
|
|
|
this.materialList.push({
|
|
|
materialId: item.materialId,
|