|
|
@@ -64,14 +64,21 @@
|
|
|
</template>
|
|
|
|
|
|
<template #slot-more-do-btn>
|
|
|
- <el-dropdown size="medium" split-button type="primary" @click="setCp" @command="doMore">
|
|
|
- 产品归类
|
|
|
+ <el-dropdown size="medium" split-button type="primary" @click="installCp" @command="doMore">
|
|
|
+ 设置产品
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="delItem">全部删除</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="toAuth">全部认证</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="delCpRelate">删除产品</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
|
|
|
+ <template #slot-select-cp="{scope}">
|
|
|
+ <el-select @change="searchSelectCp" v-model="selectCpName" filterable remote reserve-keyword placeholder="请搜索产品" :remote-method="searchCpInfo" :loading="loading" style="width:200px;margin-left:20px;" size="medium">
|
|
|
+ <el-option v-for="item in cpInfoList" :key="item.id" :label="`${item.id} ${item.name}(${item.auth == 1 ?'认证':'未认证'})`" :value="item.id"> </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
</x-crud>
|
|
|
|
|
|
<el-dialog :title="`${currentItemId == 0 ? '添加' : '修改'}花材`" :visible.sync="addDialog" :close-on-click-modal="false" width="600px" >
|
|
|
@@ -171,6 +178,11 @@ export default {
|
|
|
components: {},
|
|
|
data() {
|
|
|
return {
|
|
|
+ selectCpId:0,
|
|
|
+ selectCpName:'',
|
|
|
+ cpInfoList: [],
|
|
|
+ list: [],
|
|
|
+ loading: false,
|
|
|
app: null,
|
|
|
sortLink: '',
|
|
|
operateData: {},
|
|
|
@@ -248,18 +260,47 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
- setCp(){
|
|
|
+ searchSelectCp(e){
|
|
|
+ this.selectCpId = e
|
|
|
+ },
|
|
|
+ searchCpInfo(query) {
|
|
|
+ let that = this
|
|
|
+ if (query !== '') {
|
|
|
+ this.loading = true;
|
|
|
+ this.$service.ptCp.list({search:query}).then(res=>{
|
|
|
+ that.loading = false
|
|
|
+ that.cpInfoList = res.list
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.cpInfoList = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ installCp(){
|
|
|
if (this.$util.isEmpty(this.selects.ids)) {
|
|
|
this.$message.error('请选择花材')
|
|
|
return false
|
|
|
}
|
|
|
+ if(this.selectCpId == 0){
|
|
|
+ this.$message.error('请选择产品')
|
|
|
+ return false
|
|
|
+ }
|
|
|
},
|
|
|
- doMore(c){
|
|
|
+ doMore(cmd){
|
|
|
if (this.$util.isEmpty(this.selects.ids)) {
|
|
|
this.$message.error('请选择花材')
|
|
|
return false
|
|
|
}
|
|
|
- this.$message.success(c)
|
|
|
+ //删除产品关系
|
|
|
+ if(cmd == 'delCpRelate'){
|
|
|
+ if(this.selectCpId == 0){
|
|
|
+ this.$message.error('请选择产品')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //全部认证
|
|
|
+ if(cmd == 'toAuth'){
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
changeCpClassStyle(e){
|
|
|
this.cpClassStyle = e
|
|
|
@@ -438,13 +479,13 @@ export default {
|
|
|
prop: 'className',
|
|
|
label: '分类',
|
|
|
align: 'center',
|
|
|
- 'min-width': 100,
|
|
|
+ 'min-width':90,
|
|
|
},
|
|
|
{
|
|
|
prop: 'stockWarning',
|
|
|
- label: '库存预警',
|
|
|
+ label: '预警值',
|
|
|
align: 'center',
|
|
|
- 'min-width': 100,
|
|
|
+ 'min-width': 80,
|
|
|
},
|
|
|
{
|
|
|
prop: 'weight',
|
|
|
@@ -504,7 +545,7 @@ export default {
|
|
|
['slot-tabs'],
|
|
|
['slot-cpClassStyle','slot-cp-class','slot-item-class','search-key','flex1','slot-add-item-btn', 'refresh-btn'],
|
|
|
['data-table'],
|
|
|
- ['slot-more-do-btn','flex1', 'pagination'],
|
|
|
+ ['slot-more-do-btn','slot-select-cp','flex1', 'pagination'],
|
|
|
])
|
|
|
.done();
|
|
|
app.refresh({ classId: this.classId,cpId:this.cpId,cpClassStyle:this.cpClassStyle })
|