|
|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="app-list-content">
|
|
|
<x-crud
|
|
|
- class="liu-crud-wrap"
|
|
|
- @load="onLoad"
|
|
|
+ class="liu-crud-wrap"
|
|
|
+ @load="onLoad"
|
|
|
>
|
|
|
<template #slot-tabs>
|
|
|
<el-tabs class="liu-tabs" type="border-card" v-model="tabIndex" @tab-click="tabClick">
|
|
|
@@ -13,10 +13,10 @@
|
|
|
|
|
|
<template #table-column-cover="{ scope }">
|
|
|
<cl-avatar
|
|
|
- shape="square"
|
|
|
- :size="32"
|
|
|
- :src="scope.row.cover"
|
|
|
- :style="{ margin: 'auto' }"
|
|
|
+ shape="square"
|
|
|
+ :size="32"
|
|
|
+ :src="scope.row.cover"
|
|
|
+ :style="{ margin: 'auto' }"
|
|
|
></cl-avatar>
|
|
|
</template>
|
|
|
|
|
|
@@ -44,17 +44,23 @@
|
|
|
|
|
|
<template #slot-modify="{ scope }">
|
|
|
<el-button
|
|
|
- type="text"
|
|
|
- @click.native.stop="replaceBtnFn(scope.row.id)"
|
|
|
+ type="text"
|
|
|
+ @click.native.stop="replaceBtnFn(scope.row.id)"
|
|
|
>修改</el-button
|
|
|
>
|
|
|
</template>
|
|
|
|
|
|
- <template #table-column-addPrice="{scope}">
|
|
|
- <span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
|
|
|
- <el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
|
|
|
+ <template #table-header-cost>
|
|
|
+ <div class="set-sort">
|
|
|
+ <span>每扎成本价</span>
|
|
|
+ <el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
|
|
|
+ <el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #table-column-cost="{scope}">
|
|
|
+ <span v-if="!costPrice">{{ scope.row.cost }}</span>
|
|
|
+ <el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
|
|
|
</template>
|
|
|
-
|
|
|
<template #table-header-addPrice>
|
|
|
<div class="set-sort">
|
|
|
<span>每扎加价</span>
|
|
|
@@ -62,20 +68,23 @@
|
|
|
<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
- <template #table-header-cost>
|
|
|
+ <template #table-column-addPrice="{scope}">
|
|
|
+ <span v-if="!canAddPrice">{{ scope.row.addPrice }}</span>
|
|
|
+ <el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.addPrice" @blur="changeSort(scope.row, 'addPrice')" ></el-input>
|
|
|
+ </template>
|
|
|
+ <template #table-header-weight>
|
|
|
<div class="set-sort">
|
|
|
- <span>每扎成本价</span>
|
|
|
- <el-button v-if="!costPrice" icon="el-icon-edit-outline" size="small" type="text" @click="showCost" class="show"></el-button>
|
|
|
+ <span>重量(公斤)</span>
|
|
|
+ <el-button v-if="!costWeight" icon="el-icon-edit-outline" size="small" type="text" @click="showWeight" class="show"></el-button>
|
|
|
<el-button class="hide" v-else size="mini" @click="hideSort" type="primary">完成</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template #table-column-weight="{scope}">
|
|
|
+ <span v-if="!costWeight">{{ scope.row.weight }}</span>
|
|
|
+ <el-input style="width:50%;" ref="add-price-input" focus size="mini" v-else v-model="scope.row.weight" @blur="changeSort(scope.row, 'weight')"></el-input>
|
|
|
+ </template>
|
|
|
|
|
|
|
|
|
- <template #table-column-cost="{scope}">
|
|
|
- <span v-if="!costPrice">{{ scope.row.cost }}</span>
|
|
|
- <el-input style="width:50%;" ref="sort-input" focus size="mini" v-else v-model="scope.row.cost" @blur="changeSort(scope.row, 'cost')" ></el-input>
|
|
|
- </template>
|
|
|
<template #slot-add-goods-btn>
|
|
|
<el-button type="primary" size="mini" @click="addFn()">添加</el-button>
|
|
|
</template>
|
|
|
@@ -85,32 +94,32 @@
|
|
|
</item-list-layer>
|
|
|
<!-- 新增弹窗 -->
|
|
|
<el-dialog
|
|
|
- title="修改花材"
|
|
|
- :visible.sync="addDialog"
|
|
|
- :close-on-click-modal="false"
|
|
|
- width="600px"
|
|
|
+ title="修改花材"
|
|
|
+ :visible.sync="addDialog"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ width="600px"
|
|
|
>
|
|
|
<div class="ad-modal-content">
|
|
|
<el-form
|
|
|
- :model="replaceForm"
|
|
|
- :rules="replaceFormRules"
|
|
|
- ref="replaceForm"
|
|
|
- label-width="100px"
|
|
|
- class="demo-form"
|
|
|
+ :model="replaceForm"
|
|
|
+ :rules="replaceFormRules"
|
|
|
+ ref="replaceForm"
|
|
|
+ label-width="100px"
|
|
|
+ class="demo-form"
|
|
|
>
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
<el-input
|
|
|
- v-model="replaceForm.name"
|
|
|
- placeholder="请输入名称"
|
|
|
- size="small"
|
|
|
+ v-model="replaceForm.name"
|
|
|
+ placeholder="请输入名称"
|
|
|
+ size="small"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="别名" prop="alias">
|
|
|
<el-input
|
|
|
- v-model="replaceForm.alias"
|
|
|
- placeholder="请输入别名"
|
|
|
- size="small"
|
|
|
+ v-model="replaceForm.alias"
|
|
|
+ placeholder="请输入别名"
|
|
|
+ size="small"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -121,15 +130,15 @@
|
|
|
|
|
|
<el-form-item label="分类" prop="classId">
|
|
|
<el-select
|
|
|
- v-model="replaceForm.className"
|
|
|
- size="small"
|
|
|
- placeholder="请选择分类"
|
|
|
- @change="selClassFn"
|
|
|
+ v-model="replaceForm.className"
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择分类"
|
|
|
+ @change="selClassFn"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="(item, index) in itemClassList"
|
|
|
- :key="index"
|
|
|
- :value="item.name"
|
|
|
+ v-for="(item, index) in itemClassList"
|
|
|
+ :key="index"
|
|
|
+ :value="item.name"
|
|
|
>{{ item.name }}</el-option
|
|
|
>
|
|
|
</el-select>
|
|
|
@@ -137,33 +146,33 @@
|
|
|
|
|
|
<el-form-item label="库存预警" prop="stockWarning">
|
|
|
<el-input
|
|
|
- v-model="replaceForm.stockWarning"
|
|
|
- placeholder="请输入数值"
|
|
|
- size="small"
|
|
|
+ v-model="replaceForm.stockWarning"
|
|
|
+ placeholder="请输入数值"
|
|
|
+ size="small"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="每扎重量" prop="weight">
|
|
|
<el-input
|
|
|
- v-model="replaceForm.weight"
|
|
|
- placeholder="请输入斤数"
|
|
|
- size="small"
|
|
|
+ v-model="replaceForm.weight"
|
|
|
+ placeholder="请输入斤数"
|
|
|
+ size="small"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="每扎成本价" prop="cost">
|
|
|
<el-input
|
|
|
- v-model="replaceForm.cost"
|
|
|
- placeholder="请输入成本价"
|
|
|
- size="small"
|
|
|
+ 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"
|
|
|
+ v-model="replaceForm.addPrice"
|
|
|
+ placeholder="请输入加价"
|
|
|
+ size="small"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
|
|
|
@@ -202,6 +211,7 @@
|
|
|
},
|
|
|
canAddPrice:false,
|
|
|
costPrice: false,
|
|
|
+ costWeight: false,
|
|
|
classId: 0,
|
|
|
className:'',
|
|
|
showItemModal: false,
|
|
|
@@ -359,7 +369,7 @@
|
|
|
prop: 'name',
|
|
|
label: '名称',
|
|
|
align: 'center',
|
|
|
- 'min-width': 100
|
|
|
+ 'min-width': 180
|
|
|
},
|
|
|
{
|
|
|
prop: 'className',
|
|
|
@@ -377,7 +387,7 @@
|
|
|
prop: 'cost',
|
|
|
label: '每扎成本价',
|
|
|
align: 'center',
|
|
|
- 'min-width': 120
|
|
|
+ 'min-width': 130
|
|
|
},
|
|
|
{
|
|
|
prop: 'addPrice',
|
|
|
@@ -389,7 +399,7 @@
|
|
|
prop: 'weight',
|
|
|
label: '重量(公斤)',
|
|
|
align: 'center',
|
|
|
- 'min-width': 90
|
|
|
+ 'min-width': 130
|
|
|
},
|
|
|
{
|
|
|
prop: 'unit',
|
|
|
@@ -457,6 +467,10 @@
|
|
|
this.initData = []
|
|
|
this.canAddPrice = true
|
|
|
},
|
|
|
+ showWeight(){
|
|
|
+ this.initData = []
|
|
|
+ this.costWeight = true
|
|
|
+ },
|
|
|
showSort (e) {
|
|
|
this.initData = []
|
|
|
this.sort.status = true;
|
|
|
@@ -467,6 +481,7 @@
|
|
|
this.sort.status = false;
|
|
|
this.canAddPrice = false
|
|
|
this.costPrice = false
|
|
|
+ this.costWeight = false
|
|
|
return;
|
|
|
}
|
|
|
this.dataList.form.data = JSON.stringify(this.initData)
|
|
|
@@ -477,6 +492,7 @@
|
|
|
this.sort.status = false;
|
|
|
this.canAddPrice = false
|
|
|
this.costPrice = false
|
|
|
+ this.costWeight = false
|
|
|
},
|
|
|
replaceBtnFn(id) {
|
|
|
this.addDialog = true
|
|
|
@@ -516,6 +532,8 @@
|
|
|
obj.addPrice = d.addPrice
|
|
|
} else if(type == 'cost') {
|
|
|
obj.cost = d.cost
|
|
|
+ }else if(type == 'weight') {
|
|
|
+ obj.weight = d.weight
|
|
|
}
|
|
|
this.initData.push(obj)
|
|
|
}
|