|
@@ -32,7 +32,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #table-column-unit="{scope}">
|
|
<template #table-column-unit="{scope}">
|
|
|
- <span>{{ scope.row.bigUnit }} / {{scope.row.smallUnit}}</span>
|
|
|
|
|
|
|
+ <span>{{ scope.row.ratio }}{{ scope.row.bigUnit }}/{{scope.row.smallUnit}}</span>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<template #table-column-inTurn="{ scope }">
|
|
<template #table-column-inTurn="{ scope }">
|
|
@@ -110,14 +110,6 @@
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item label="别名" prop="alias">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="replaceForm.alias"
|
|
|
|
|
- placeholder="请输入别名"
|
|
|
|
|
- size="small"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
<el-form-item label="图片" prop="cover">
|
|
<el-form-item label="图片" prop="cover">
|
|
|
<cl-upload v-model="replaceForm.cover" :success="uploadSuccess"></cl-upload>
|
|
<cl-upload v-model="replaceForm.cover" :success="uploadSuccess"></cl-upload>
|
|
|
<p style="font-size: 14px; color: #cccccc">建议上传图片比例 400X400</p>
|
|
<p style="font-size: 14px; color: #cccccc">建议上传图片比例 400X400</p>
|
|
@@ -151,6 +143,12 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
+ <el-form-item label="单位比类型" prop="ratioType">
|
|
|
|
|
+ <el-select v-model="replaceForm.ratioTypeName" size="small" placeholder="请选择单位" @change="changeRatioTypeFn">
|
|
|
|
|
+ <el-option v-for="(item, index) in ratioTypeList" :key="index" :value="item.name" >{{ item.name }}</el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
<el-form-item label="单位比" prop="ratio">
|
|
<el-form-item label="单位比" prop="ratio">
|
|
|
<el-input
|
|
<el-input
|
|
|
v-model="replaceForm.ratio"
|
|
v-model="replaceForm.ratio"
|
|
@@ -175,21 +173,6 @@
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
|
|
- <el-form-item label="每扎成本价" prop="cost">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="replaceForm.cost"
|
|
|
|
|
- placeholder="请输入成本价"
|
|
|
|
|
- size="small"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
-
|
|
|
|
|
- <el-form-item label="每扎加价" prop="addPrice">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="replaceForm.addPrice"
|
|
|
|
|
- placeholder="请输入加价"
|
|
|
|
|
- size="small"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
@@ -227,7 +210,6 @@ export default {
|
|
|
replaceForm: {
|
|
replaceForm: {
|
|
|
name: '',
|
|
name: '',
|
|
|
py:'',
|
|
py:'',
|
|
|
- alias: '',
|
|
|
|
|
classId: '',
|
|
classId: '',
|
|
|
className: '',
|
|
className: '',
|
|
|
cover: '',
|
|
cover: '',
|
|
@@ -236,10 +218,10 @@ export default {
|
|
|
smallUnitId: '',
|
|
smallUnitId: '',
|
|
|
smallUnit: '',
|
|
smallUnit: '',
|
|
|
stockWarning:'',
|
|
stockWarning:'',
|
|
|
- cost:'',
|
|
|
|
|
- addPrice:'',
|
|
|
|
|
weight:'',
|
|
weight:'',
|
|
|
- ratio:''
|
|
|
|
|
|
|
+ ratio:'',
|
|
|
|
|
+ ratioType:0,
|
|
|
|
|
+ ratioTypeName:''
|
|
|
},
|
|
},
|
|
|
replaceFormRules: {
|
|
replaceFormRules: {
|
|
|
name: {
|
|
name: {
|
|
@@ -270,14 +252,6 @@ export default {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: '最低库存不能为空',
|
|
message: '最低库存不能为空',
|
|
|
},
|
|
},
|
|
|
- cost: {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '运费不能为空',
|
|
|
|
|
- },
|
|
|
|
|
- addPrice: {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '加价不能为空',
|
|
|
|
|
- },
|
|
|
|
|
weight: {
|
|
weight: {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: '重量不能为空',
|
|
message: '重量不能为空',
|
|
@@ -286,6 +260,7 @@ export default {
|
|
|
//分类列表
|
|
//分类列表
|
|
|
itemClassList: [],
|
|
itemClassList: [],
|
|
|
unitList: [],
|
|
unitList: [],
|
|
|
|
|
+ ratioTypeList:[{name:'固定比例',id:0},{name:'模糊比例',id:1}],
|
|
|
currentItemId: 0
|
|
currentItemId: 0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -299,6 +274,11 @@ export default {
|
|
|
let index = this.unitList.findIndex((e) => e.name == val);
|
|
let index = this.unitList.findIndex((e) => e.name == val);
|
|
|
this.replaceForm.bigUnitId = this.unitList[index].id;
|
|
this.replaceForm.bigUnitId = this.unitList[index].id;
|
|
|
},
|
|
},
|
|
|
|
|
+ changeRatioTypeFn(val){
|
|
|
|
|
+ console.log(val)
|
|
|
|
|
+ let index = this.ratioTypeList.findIndex((e) => e.name == val);
|
|
|
|
|
+ this.replaceForm.ratioType = this.ratioTypeList[index].id;
|
|
|
|
|
+ },
|
|
|
selSmallUnitFn(val) {
|
|
selSmallUnitFn(val) {
|
|
|
let index = this.unitList.findIndex((e) => e.name == val);
|
|
let index = this.unitList.findIndex((e) => e.name == val);
|
|
|
this.replaceForm.smallUnitId = this.unitList[index].id;
|
|
this.replaceForm.smallUnitId = this.unitList[index].id;
|
|
@@ -331,7 +311,6 @@ export default {
|
|
|
this.replaceFormRules = {};
|
|
this.replaceFormRules = {};
|
|
|
this.replaceForm = {
|
|
this.replaceForm = {
|
|
|
name: '',
|
|
name: '',
|
|
|
- alias: '',
|
|
|
|
|
classId:'',
|
|
classId:'',
|
|
|
cover: '',
|
|
cover: '',
|
|
|
bigUnitId: '',
|
|
bigUnitId: '',
|
|
@@ -339,11 +318,10 @@ export default {
|
|
|
smallUnitId: '',
|
|
smallUnitId: '',
|
|
|
smallUnit: '',
|
|
smallUnit: '',
|
|
|
stockWarning:'',
|
|
stockWarning:'',
|
|
|
- cost:'',
|
|
|
|
|
- addPrice:'',
|
|
|
|
|
className:'',
|
|
className:'',
|
|
|
weight:'',
|
|
weight:'',
|
|
|
ratio:'',
|
|
ratio:'',
|
|
|
|
|
+ ratioType:0,
|
|
|
py:''
|
|
py:''
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
@@ -377,14 +355,6 @@ export default {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: '最低库存不能为空',
|
|
message: '最低库存不能为空',
|
|
|
},
|
|
},
|
|
|
- cost: {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '运费不能为空',
|
|
|
|
|
- },
|
|
|
|
|
- addPrice: {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: '加价不能为空',
|
|
|
|
|
- },
|
|
|
|
|
weight: {
|
|
weight: {
|
|
|
required: true,
|
|
required: true,
|
|
|
message: '重量不能为空',
|
|
message: '重量不能为空',
|
|
@@ -392,17 +362,20 @@ export default {
|
|
|
};
|
|
};
|
|
|
let index = this.itemClassList.findIndex((e) => e.id == res.classId)
|
|
let index = this.itemClassList.findIndex((e) => e.id == res.classId)
|
|
|
this.replaceForm.name = res.name
|
|
this.replaceForm.name = res.name
|
|
|
- this.replaceForm.alias = res.alias
|
|
|
|
|
this.replaceForm.cover = res.cover
|
|
this.replaceForm.cover = res.cover
|
|
|
this.replaceForm.bigUnitId = res.bigUnitId
|
|
this.replaceForm.bigUnitId = res.bigUnitId
|
|
|
this.replaceForm.bigUnit = res.bigUnit
|
|
this.replaceForm.bigUnit = res.bigUnit
|
|
|
this.replaceForm.smallUnitId = res.smallUnitId
|
|
this.replaceForm.smallUnitId = res.smallUnitId
|
|
|
this.replaceForm.smallUnit = res.smallUnit
|
|
this.replaceForm.smallUnit = res.smallUnit
|
|
|
this.replaceForm.stockWarning = res.stockWarning
|
|
this.replaceForm.stockWarning = res.stockWarning
|
|
|
- this.replaceForm.cost = res.cost
|
|
|
|
|
- this.replaceForm.addPrice = res.addPrice
|
|
|
|
|
this.replaceForm.weight = res.weight
|
|
this.replaceForm.weight = res.weight
|
|
|
this.replaceForm.ratio = res.ratio
|
|
this.replaceForm.ratio = res.ratio
|
|
|
|
|
+ this.replaceForm.ratioType = res.ratioType
|
|
|
|
|
+ if(res.ratioType == 0){
|
|
|
|
|
+ this.replaceForm.ratioTypeName = '固定比例'
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.replaceForm.ratioTypeName = '模糊比例'
|
|
|
|
|
+ }
|
|
|
this.replaceForm.classId = res.classId
|
|
this.replaceForm.classId = res.classId
|
|
|
this.replaceForm.py = res.py
|
|
this.replaceForm.py = res.py
|
|
|
this.replaceForm.className = this.itemClassList[index].name
|
|
this.replaceForm.className = this.itemClassList[index].name
|
|
@@ -455,18 +428,6 @@ export default {
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
'min-width': 100,
|
|
'min-width': 100,
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'cost',
|
|
|
|
|
- label: '每扎成本价',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- 'min-width': 100,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- prop: 'addPrice',
|
|
|
|
|
- label: '每扎加价',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- 'min-width': 100,
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
prop: 'weight',
|
|
prop: 'weight',
|
|
|
label: '重量(公斤)',
|
|
label: '重量(公斤)',
|
|
@@ -479,12 +440,6 @@ export default {
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
minWidth: 100,
|
|
minWidth: 100,
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- prop: 'ratio',
|
|
|
|
|
- label: '单位比',
|
|
|
|
|
- align: 'center',
|
|
|
|
|
- minWidth: 60,
|
|
|
|
|
- },
|
|
|
|
|
{
|
|
{
|
|
|
prop: 'inTurn',
|
|
prop: 'inTurn',
|
|
|
label: '排序',
|
|
label: '排序',
|
|
@@ -524,7 +479,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
.set('layout', [
|
|
.set('layout', [
|
|
|
['slot-tabs'],['search-key'],
|
|
['slot-tabs'],['search-key'],
|
|
|
- ['flex1', 'slot-add-goods-btn', 'refresh-btn'],
|
|
|
|
|
|
|
+ ['flex1', 'refresh-btn'],
|
|
|
['data-table'],
|
|
['data-table'],
|
|
|
['flex1', 'pagination'],
|
|
['flex1', 'pagination'],
|
|
|
])
|
|
])
|