|
@@ -9,7 +9,16 @@
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
<el-row>
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="type === '1' ? 12 : 24">
|
|
|
+ <el-form-item label="商品分类" prop="goods_name">
|
|
|
+ <good-class
|
|
|
+ :value="ruleForm.goods_class"
|
|
|
+ @handleChange="goods_class_change"
|
|
|
+ :placeholder="'商品分类'"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="type === '1' ? 12 : 24">
|
|
|
<el-form-item label="商品名称" prop="goods_name">
|
|
|
<el-input
|
|
|
:disabled="
|
|
@@ -20,12 +29,13 @@
|
|
|
"
|
|
|
v-model="ruleForm.goods_name"
|
|
|
readonly="true"
|
|
|
+ :placeholder="'商品名称'"
|
|
|
@focus="hand"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 采购数量 -->
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="type === '1' ? 12 : 24">
|
|
|
<el-form-item label="采购数量" prop="goods_num">
|
|
|
<el-input
|
|
|
:disabled="
|
|
@@ -40,7 +50,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 最晚入库时间 -->
|
|
|
- <el-col :span="24">
|
|
|
+ <el-col :span="type === '1' ? 12 : 24">
|
|
|
<el-form-item label="最晚入库时间" prop="last_go_stock">
|
|
|
<el-date-picker
|
|
|
v-model="ruleForm.last_go_stock"
|
|
@@ -61,8 +71,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 供应商选择 -->
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="供应商名称" prop="supplier_code">
|
|
|
+ <el-col :span="type === '1' ? 12 : 24">
|
|
|
+ <el-form-item label="入库公司" prop="supplier_code">
|
|
|
<search-supplier
|
|
|
:disabled="
|
|
|
!(
|
|
@@ -71,19 +81,19 @@
|
|
|
)
|
|
|
"
|
|
|
:value="ruleForm.supplier_code"
|
|
|
- :placeholder="'请选择供应商'"
|
|
|
+ :placeholder="'入库公司'"
|
|
|
:names="''"
|
|
|
@searchChange="selectSupplier"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<!-- 仓库名称 -->
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="仓库名称" prop="stock_code">
|
|
|
+ <el-col :span="type === '1' ? 12 : 24">
|
|
|
+ <el-form-item label="入库仓库" prop="stock_code">
|
|
|
<search-stock
|
|
|
:disabled="!(id == 'add' || status === '0')"
|
|
|
:value="ruleForm.stock_code"
|
|
|
- :placeholder="'请选择备库仓库'"
|
|
|
+ :placeholder="'入库仓库'"
|
|
|
:isRelation="true"
|
|
|
:names="''"
|
|
|
:companyCode="companyCode"
|
|
@@ -120,7 +130,7 @@ import { isnumber } from "@/utils/validate";
|
|
|
import searchStockGoodModal from "@/components/search-stock-good-modal";
|
|
|
export default {
|
|
|
name: "storeManage",
|
|
|
- props: ["id", "sitem", "newTime"],
|
|
|
+ props: ["id", "sitem", "newTime", "type"],
|
|
|
mixins: [resToken],
|
|
|
components: { searchStockGoodModal },
|
|
|
computed: {
|
|
@@ -169,6 +179,7 @@ export default {
|
|
|
loading: false,
|
|
|
ruleForm: {
|
|
|
id: "",
|
|
|
+ goods_class: [],
|
|
|
good_code: "",
|
|
|
good_type_code: "",
|
|
|
goods_name: "",
|
|
@@ -180,6 +191,14 @@ export default {
|
|
|
},
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
+ goods_class: [
|
|
|
+ {
|
|
|
+ type: "array",
|
|
|
+ required: true,
|
|
|
+ message: "请选择商品分类",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
//出入库规则
|
|
|
goods_name: [
|
|
|
{
|
|
@@ -206,7 +225,7 @@ export default {
|
|
|
{
|
|
|
type: "array",
|
|
|
required: true,
|
|
|
- message: "请选择供应商",
|
|
|
+ message: "请选择供入库公司",
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
@@ -214,7 +233,7 @@ export default {
|
|
|
{
|
|
|
type: "array",
|
|
|
required: true,
|
|
|
- message: "请选择仓库",
|
|
|
+ message: "请选择入库仓库",
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
@@ -236,6 +255,14 @@ export default {
|
|
|
await this.resetForm();
|
|
|
this.loading = false;
|
|
|
},
|
|
|
+ goods_class_change(e) {
|
|
|
+ this.ruleForm.goods_class = e;
|
|
|
+ this.$refs.ruleForm.validateField("goods_class");
|
|
|
+ this.ruleForm.good_type_code = "";
|
|
|
+ this.ruleForm.goods_name = "";
|
|
|
+ this.ruleForm.goods_num = "";
|
|
|
+ this.$refs.ruleForm.validateField("good_type_code");
|
|
|
+ },
|
|
|
// 最晚入库时间选择
|
|
|
selectTime(e) {
|
|
|
this.ruleForm.expecttime = e;
|
|
@@ -273,6 +300,10 @@ export default {
|
|
|
this.$refs.ruleForm.validateField("goods_name");
|
|
|
},
|
|
|
hand() {
|
|
|
+ if (this.ruleForm.goods_class.length === 0) {
|
|
|
+ this.$message.warning("请选择商品分类!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.showGoodsModel = true;
|
|
|
},
|
|
|
// 最晚入库时间选择
|
|
@@ -306,6 +337,7 @@ export default {
|
|
|
this.companyCode = wsm_supplierNo;
|
|
|
this.ruleForm = {
|
|
|
id,
|
|
|
+ goods_class: [],
|
|
|
good_code,
|
|
|
good_type_code,
|
|
|
goods_name: good_name,
|