|
|
|
@ -42,6 +42,13 @@
|
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="当前库存" align="center" prop="stock" /> |
|
|
|
|
<el-table-column label="ERP物料id" align="center" prop="materialId" /> |
|
|
|
|
<el-table-column label="ERP物料名字" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span v-if="scope.row.materialId"> {{materialList.find(t=>t.id == scope.row.materialId ).name}} </span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
@ -72,6 +79,15 @@
|
|
|
|
|
<el-form-item label="当前库存" prop="stock"> |
|
|
|
|
<el-input v-model="form.stock" placeholder="请输入当前库存" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
<el-form-item label="ERP物料id" prop="materialId"> |
|
|
|
|
<el-select v-model="form.materialId" filterable placeholder="请先选择ERP物料"> |
|
|
|
|
<el-option v-for="item in materialList" :key="item.id" :label="item.name" :value="item.id"> |
|
|
|
|
{{ item.name }} |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
@ -82,7 +98,7 @@
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { createCrop, updateCrop, deleteCrop, getCrop, getCropPage, exportCropExcel } from "@/api/farm/crop"; |
|
|
|
|
import { createCrop, updateCrop, deleteCrop, getCrop, getCropPage, exportCropExcel, getMaterialList } from "@/api/farm/crop"; |
|
|
|
|
import ImageUpload from '@/components/ImageUpload'; |
|
|
|
|
import Editor from '@/components/Editor'; |
|
|
|
|
|
|
|
|
@ -123,7 +139,9 @@ export default {
|
|
|
|
|
rules: { |
|
|
|
|
name: [{ required: true, message: "物料名不能为空", trigger: "blur" }], |
|
|
|
|
stock: [{ required: true, message: "当前库存不能为空", trigger: "blur" }], |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
materialList :[] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
@ -141,8 +159,14 @@ export default {
|
|
|
|
|
this.list = response.data.list; |
|
|
|
|
this.total = response.data.total; |
|
|
|
|
this.loading = false; |
|
|
|
|
this.getErpMaterial(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getErpMaterial(){ |
|
|
|
|
getMaterialList().then(res =>{ |
|
|
|
|
this.materialList = res; |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** 取消按钮 */ |
|
|
|
|
cancel() { |
|
|
|
|
this.open = false; |
|
|
|
@ -155,6 +179,7 @@ export default {
|
|
|
|
|
name: undefined, |
|
|
|
|
images: undefined, |
|
|
|
|
stock: undefined, |
|
|
|
|
materialId: undefined, |
|
|
|
|
}; |
|
|
|
|
this.resetForm("form"); |
|
|
|
|
}, |
|
|
|
|