|
|
@@ -83,7 +83,11 @@
|
|
|
|
|
|
<template #slot-modify="{ scope }">
|
|
|
|
|
|
- <el-popover style="margin-right:10px;" placement="top" width="160" :ref="'popover-' + scope.row.id">
|
|
|
+ <el-button type="text" @click.native.stop="replaceBtnFn(scope.row.id)" >修改</el-button>
|
|
|
+ <el-button type="text" v-if="scope.row.status==2" @click.native.stop="setStatusFun(scope.row.id,1)" >上架</el-button>
|
|
|
+ <el-button type="text" v-if="scope.row.status==1" @click.native.stop="setStatusFun(scope.row.id,2)" >下架</el-button>
|
|
|
+
|
|
|
+ <el-popover style="margin-left:10px;margin-right:10px;" placement="top" width="160" :ref="'popover-' + scope.row.id">
|
|
|
<p>确认复制生成花材?</p>
|
|
|
<div style="text-align: right; margin: 0">
|
|
|
<el-button size="mini" type="text" @click.stop="cancelCopyProduct(scope.row.id)">取消</el-button>
|
|
|
@@ -92,10 +96,6 @@
|
|
|
<el-button slot="reference" size="mini" type="text" plain @click.stop="">复制</el-button>
|
|
|
</el-popover>
|
|
|
|
|
|
- <el-button type="text" @click.native.stop="replaceBtnFn(scope.row.id)" >修改</el-button>
|
|
|
- <el-button type="text" v-if="scope.row.status==2" @click.native.stop="setStatusFun(scope.row.id,1)" >上架</el-button>
|
|
|
- <el-button type="text" v-if="scope.row.status==1" @click.native.stop="setStatusFun(scope.row.id,2)" >下架</el-button>
|
|
|
-
|
|
|
<el-button type="text" v-if="scope.row.delStatus==0" @click.native.stop="setDelStatusFun(scope.row.id,1)" >删除</el-button>
|
|
|
<el-button type="text" v-if="scope.row.delStatus==1" @click.native.stop="setDelStatusFun(scope.row.id,0)" >恢复</el-button>
|
|
|
|
|
|
@@ -215,32 +215,30 @@
|
|
|
<el-option v-for="(item, index) in itemClassList" :key="index" :value="item.name">{{ item.name }}</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="库存" prop="ratio">
|
|
|
- <el-input v-model="replaceForm.stock" @focus="replaceForm.stock=''" placeholder="请输入" size="small" ></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="大单位" prop="bigUnitId">
|
|
|
- <el-select v-model="replaceForm.bigUnit" size="small" placeholder="请选择单位" @change="selBigUnitFn">
|
|
|
- <el-option v-for="(item, index) in unitList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
|
|
|
- <el-form-item label="小单位" prop="smallUnitId">
|
|
|
- <el-select v-model="replaceForm.smallUnit" size="small" placeholder="请选择单位" @change="selSmallUnitFn">
|
|
|
- <el-option v-for="(item, index) in unitList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="库存" prop="stock">
|
|
|
+ <el-input v-model="replaceForm.stock" @focus="replaceForm.stock=''" placeholder="请输入" size="small" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item label="单位比" prop="ratio">
|
|
|
- <el-input v-model="replaceForm.ratio" placeholder="1扎=20支,请输入20" size="small" ></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="大单位" prop="bigUnitId">
|
|
|
+ <el-select v-model="replaceForm.bigUnit" size="small" placeholder="请选择单位" @change="selBigUnitFn">
|
|
|
+ <el-option v-for="(item, index) in unitList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item label="库存预警" prop="stockWarning">
|
|
|
- <el-input
|
|
|
- v-model="replaceForm.stockWarning"
|
|
|
- placeholder="请输入数值"
|
|
|
- size="small"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="小单位" prop="smallUnitId">
|
|
|
+ <el-select v-model="replaceForm.smallUnit" size="small" placeholder="请选择单位" @change="selSmallUnitFn">
|
|
|
+ <el-option v-for="(item, index) in unitList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="单位比" prop="ratio">
|
|
|
+ <el-input v-model="replaceForm.ratio" placeholder="1扎=20支,请输入20" size="small" ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item label="库存预警" prop="stockWarning">
|
|
|
+ <el-input v-model="replaceForm.stockWarning" placeholder="请输入数值" size="small"></el-input>
|
|
|
+ </el-form-item>
|
|
|
|
|
|
<el-form-item label="每扎重量" prop="weight">
|
|
|
<el-input
|
|
|
@@ -371,46 +369,50 @@ export default {
|
|
|
weight:'',
|
|
|
},
|
|
|
replaceFormRules: {
|
|
|
- name: {
|
|
|
- required: true,
|
|
|
- message: '名称不能为空',
|
|
|
- },
|
|
|
- cover: {
|
|
|
- required: true,
|
|
|
- message: '图片不能为空',
|
|
|
- },
|
|
|
- classId: {
|
|
|
- required: true,
|
|
|
- message: '请选择分类',
|
|
|
- },
|
|
|
- bigUnitId: {
|
|
|
- required: true,
|
|
|
- message: '请选择大单位',
|
|
|
- },
|
|
|
- smallUnitId: {
|
|
|
- required: true,
|
|
|
- message: '请选择小单位',
|
|
|
- },
|
|
|
- ratio: {
|
|
|
- required: true,
|
|
|
- message: '比例不能为空',
|
|
|
- },
|
|
|
- stockWarning: {
|
|
|
- required: true,
|
|
|
- message: '最低库存不能为空',
|
|
|
- },
|
|
|
- cost: {
|
|
|
- required: true,
|
|
|
- message: '运费不能为空',
|
|
|
- },
|
|
|
- addPrice: {
|
|
|
- required: true,
|
|
|
- message: '加价不能为空',
|
|
|
- },
|
|
|
- weight: {
|
|
|
- required: true,
|
|
|
- message: '重量不能为空',
|
|
|
- }
|
|
|
+ name: {
|
|
|
+ required: true,
|
|
|
+ message: '名称不能为空',
|
|
|
+ },
|
|
|
+ cover: {
|
|
|
+ required: true,
|
|
|
+ message: '图片不能为空',
|
|
|
+ },
|
|
|
+ classId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择分类',
|
|
|
+ },
|
|
|
+ bigUnitId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择大单位',
|
|
|
+ },
|
|
|
+ smallUnitId: {
|
|
|
+ required: true,
|
|
|
+ message: '请选择小单位',
|
|
|
+ },
|
|
|
+ ratio: {
|
|
|
+ required: true,
|
|
|
+ message: '比例不能为空',
|
|
|
+ },
|
|
|
+ stockWarning: {
|
|
|
+ required: true,
|
|
|
+ message: '最低库存不能为空',
|
|
|
+ },
|
|
|
+ cost: {
|
|
|
+ required: true,
|
|
|
+ message: '运费不能为空',
|
|
|
+ },
|
|
|
+ stock: {
|
|
|
+ required: true,
|
|
|
+ message: '没有库存请填0',
|
|
|
+ },
|
|
|
+ addPrice: {
|
|
|
+ required: true,
|
|
|
+ message: '加价不能为空',
|
|
|
+ },
|
|
|
+ weight: {
|
|
|
+ required: true,
|
|
|
+ message: '重量不能为空',
|
|
|
+ }
|
|
|
},
|
|
|
itemClassList: [],
|
|
|
unitList: [],
|
|
|
@@ -851,9 +853,7 @@ export default {
|
|
|
replaceBtnFn(id) {
|
|
|
this.addDialog = true
|
|
|
this.currentItemId = id;
|
|
|
-
|
|
|
if(id==0){
|
|
|
- this.replaceFormRules = {};
|
|
|
this.replaceForm = {
|
|
|
name: '',
|
|
|
py: '',
|
|
|
@@ -868,58 +868,17 @@ export default {
|
|
|
cost:'',
|
|
|
addPrice:'',
|
|
|
weight:'',
|
|
|
+ stock:'',
|
|
|
};
|
|
|
|
|
|
//大小单位默认给设置为扎和支
|
|
|
- this.replaceForm.bigUnitId = this.unitList[0].id;
|
|
|
- this.replaceForm.bigUnit = this.unitList[0].name;
|
|
|
- this.replaceForm.smallUnitId = this.unitList[1].id;
|
|
|
- this.replaceForm.smallUnit = this.unitList[1].name;
|
|
|
- this.$forceUpdate();
|
|
|
+ this.replaceForm.bigUnitId = this.unitList[0].id;
|
|
|
+ this.replaceForm.bigUnit = this.unitList[0].name;
|
|
|
+ this.replaceForm.smallUnitId = this.unitList[1].id;
|
|
|
+ this.replaceForm.smallUnit = this.unitList[1].name;
|
|
|
+ this.$forceUpdate();
|
|
|
|
|
|
}else{
|
|
|
- this.replaceFormRules = {
|
|
|
- name: {
|
|
|
- required: true,
|
|
|
- message: '名称不能为空',
|
|
|
- },
|
|
|
- cover: {
|
|
|
- required: true,
|
|
|
- message: '图片不能为空',
|
|
|
- },
|
|
|
- classId: {
|
|
|
- required: true,
|
|
|
- message: '请选择分类',
|
|
|
- },
|
|
|
- bigUnitId: {
|
|
|
- required: true,
|
|
|
- message: '请选择大单位',
|
|
|
- },
|
|
|
- smallUnitId: {
|
|
|
- required: true,
|
|
|
- message: '请选择小单位',
|
|
|
- },
|
|
|
- ratio: {
|
|
|
- required: true,
|
|
|
- message: '比例不能为空',
|
|
|
- },
|
|
|
- stockWarning: {
|
|
|
- required: true,
|
|
|
- message: '最低库存不能为空',
|
|
|
- },
|
|
|
- cost: {
|
|
|
- required: true,
|
|
|
- message: '运费不能为空',
|
|
|
- },
|
|
|
- addPrice: {
|
|
|
- required: true,
|
|
|
- message: '加价不能为空',
|
|
|
- },
|
|
|
- weight: {
|
|
|
- required: true,
|
|
|
- message: '重量不能为空',
|
|
|
- }
|
|
|
- };
|
|
|
this.$service.product.info({id}).then(res => {
|
|
|
let index = this.itemClassList.findIndex((e) => e.id == res.classId)
|
|
|
this.replaceForm = res
|