|
|
@@ -1,32 +1,13 @@
|
|
|
<template>
|
|
|
- <el-dialog
|
|
|
- title="选择花材"
|
|
|
- :visible.sync="selDialog"
|
|
|
- :close-on-click-modal="false"
|
|
|
- :append-to-body="true"
|
|
|
- @close="$emit('update:show', false)"
|
|
|
- width="800px"
|
|
|
- >
|
|
|
+ <el-dialog title="选择花材" :visible.sync="selDialog" :close-on-click-modal="false" :append-to-body="true" @close="$emit('update:show', false)" width="950px">
|
|
|
<div class="recharge-modal-content">
|
|
|
- <el-checkbox-group
|
|
|
- v-model="checkList"
|
|
|
- class="radio-wrap"
|
|
|
- >
|
|
|
- <x-crud
|
|
|
- class="liu-crud-wrap"
|
|
|
- @load="onLoad"
|
|
|
- >
|
|
|
+ <el-checkbox-group v-model="checkList" class="radio-wrap">
|
|
|
+ <x-crud class="liu-crud-wrap" @load="onLoad">
|
|
|
+
|
|
|
<template #table-column-radio="{scope}">
|
|
|
<div>
|
|
|
- <el-checkbox
|
|
|
- v-if="scope.row.select == 2"
|
|
|
- disabled
|
|
|
- :label="scope.row"
|
|
|
- >{{scope.row.id}}</el-checkbox>
|
|
|
- <el-checkbox
|
|
|
- v-else
|
|
|
- :label="scope.row"
|
|
|
- >{{scope.row.id}}</el-checkbox>
|
|
|
+ <el-checkbox v-if="scope.row.select == 2" disabled :label="scope.row" >{{scope.row.id}}</el-checkbox>
|
|
|
+ <el-checkbox v-else :label="scope.row">{{scope.row.id}}</el-checkbox>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -36,56 +17,39 @@
|
|
|
</template>
|
|
|
|
|
|
<template #table-column-stockWarning="{scope}">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.stockWarning"
|
|
|
- placeholder="最低库存"
|
|
|
- size="small"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="scope.row.stockWarning" placeholder="库存预警值" size="small"></el-input>
|
|
|
</template>
|
|
|
|
|
|
<template #table-column-cost="{scope}">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.cost"
|
|
|
- placeholder="成本价"
|
|
|
- size="small"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="scope.row.cost" placeholder="成本价" size="small" ></el-input>
|
|
|
</template>
|
|
|
|
|
|
<template #table-column-addPrice="{scope}">
|
|
|
- <el-input
|
|
|
- v-model="scope.row.addPrice"
|
|
|
- placeholder="加价"
|
|
|
- size="small"
|
|
|
- ></el-input>
|
|
|
+ <el-input v-model="scope.row.addPrice" placeholder="加价" size="small"></el-input>
|
|
|
</template>
|
|
|
|
|
|
<template #table-column-cover="{scope}">
|
|
|
<div>
|
|
|
- <cl-avatar
|
|
|
- shape="square"
|
|
|
- :size="40"
|
|
|
- :src="scope.row.cover | default_avatar"
|
|
|
- :style="{ margin: 'auto' }"
|
|
|
- ></cl-avatar>
|
|
|
+ <cl-avatar shape="square" :size="40" :src="scope.row.cover | default_avatar" :style="{ margin: 'auto' }" ></cl-avatar>
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
</x-crud>
|
|
|
</el-checkbox-group>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <el-select v-model="sonClassName" size="small" placeholder="请选择分类" @change="selClassFn">
|
|
|
+ <el-option v-for="(item, index) in itemClassList" :key="index" :value="item.name">{{ item.name }}</el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
- <div
|
|
|
- slot="footer"
|
|
|
- class="dialog-footer"
|
|
|
- >
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- @click="resetForm"
|
|
|
- >取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- @click="confirmFn"
|
|
|
- >确定</el-button>
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="small" @click="resetForm" >取 消</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="confirmFn">确定</el-button>
|
|
|
</div>
|
|
|
+
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
|
|
|
@@ -97,9 +61,17 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
+ classId: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ },
|
|
|
multi: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
+ },
|
|
|
+ className:{
|
|
|
+ type: String,
|
|
|
+ default:''
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
|
@@ -108,30 +80,55 @@ export default {
|
|
|
ruleForm: {},
|
|
|
checkList: [],
|
|
|
list: [],
|
|
|
+ //分类列表
|
|
|
+ itemClassList: [],
|
|
|
+ sonClassId:0,
|
|
|
+ sonClassName:''
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
},
|
|
|
watch: {
|
|
|
show () {
|
|
|
- console.log(this.show)
|
|
|
this.selDialog = this.show;
|
|
|
}
|
|
|
},
|
|
|
created () { },
|
|
|
methods: {
|
|
|
+ selClassFn(val){
|
|
|
+ let index = this.itemClassList.findIndex((e) => e.name == val)
|
|
|
+ this.sonClassId = this.itemClassList[index].id
|
|
|
+ },
|
|
|
+ getAllClass() {
|
|
|
+ if (!this.$util.isEmpty(this.itemClassList)) {
|
|
|
+ return this.itemClassList
|
|
|
+ }
|
|
|
+ this.$service.itemClass.getAllClass().then((res) => {
|
|
|
+ this.itemClassList = res.list
|
|
|
+ })
|
|
|
+ },
|
|
|
confirmFn () {
|
|
|
- if (this.checkList.length > 0) {
|
|
|
- this.$emit('confirm', this.checkList);
|
|
|
- } else {
|
|
|
- this.$message.warning('请至少选择一项花材');
|
|
|
+ if (this.checkList.length == 0) {
|
|
|
+ this.$message.warning('请选择花材')
|
|
|
+ return false
|
|
|
}
|
|
|
-
|
|
|
+ if(this.classId == 0){
|
|
|
+ this.$message.warning('请选择花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.$emit('confirm', {list:this.checkList,classId:this.sonClassId})
|
|
|
},
|
|
|
resetForm () {
|
|
|
this.$emit('cancel');
|
|
|
},
|
|
|
onLoad ({ ctx, app }) {
|
|
|
+
|
|
|
+ this.sonClassId = this.classId
|
|
|
+ this.sonClassName = this.className
|
|
|
+
|
|
|
+ //分类列表
|
|
|
+ this.getAllClass()
|
|
|
+
|
|
|
this.app = app;
|
|
|
|
|
|
let getItemList = () => {
|
|
|
@@ -146,13 +143,13 @@ export default {
|
|
|
prop: 'radio',
|
|
|
label: '选择',
|
|
|
align: 'center',
|
|
|
- width: 120
|
|
|
+ width: 110
|
|
|
},
|
|
|
{
|
|
|
prop: 'cover',
|
|
|
label: '图片',
|
|
|
align: 'center',
|
|
|
- width: 130
|
|
|
+ width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'name',
|
|
|
@@ -161,7 +158,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
prop: 'stockWarning',
|
|
|
- label: '最低库存提醒',
|
|
|
+ label: '库存预警值',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
@@ -174,6 +171,11 @@ export default {
|
|
|
label: '加价',
|
|
|
align: 'center'
|
|
|
},
|
|
|
+ {
|
|
|
+ prop: 'weight',
|
|
|
+ label: '重量',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
{
|
|
|
prop: 'select',
|
|
|
label: '已添加',
|
|
|
@@ -182,8 +184,6 @@ export default {
|
|
|
],
|
|
|
on: {
|
|
|
'row-click': (row, column) => {
|
|
|
- console.log(666666666666666)
|
|
|
- console.log(row)
|
|
|
}
|
|
|
},
|
|
|
// 操作列
|