This commit is contained in:
parent
131770e3d8
commit
e55a87bf39
|
@ -0,0 +1,134 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- 阻止扫码枪的Enter事件自动提交el-form的提交特性 -->
|
||||
<!-- <el-form @submit.native.prevent>
|
||||
<el-form-item label="输入条码">
|
||||
<el-input
|
||||
v-model="barcode"
|
||||
type="text"
|
||||
placeholder="输入条码"
|
||||
@keyup.native="handleKeyUp"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
let barcodeVue = {
|
||||
name: "Barcodescan",
|
||||
props: {
|
||||
shopName: {
|
||||
type: String,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
realBarcode: "",
|
||||
keyupLastTime: undefined,
|
||||
name: undefined,
|
||||
regexRules: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
let that = this;
|
||||
// 监听页面的keyup事件
|
||||
document.onkeyup = function (e) {
|
||||
that.handleKeyUp(e);
|
||||
};
|
||||
this.name = this.shopName;
|
||||
this.initRegexRules();
|
||||
},
|
||||
methods: {
|
||||
// 初始化条码规则(自定义)
|
||||
initRegexRules() {
|
||||
this.regexRules = [
|
||||
{
|
||||
regex: "/^IN(\\w|\\d)+$/",
|
||||
value: "putInStorageNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^CH(\\w|\\d)+$/",
|
||||
value: "checkNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^AL(\\w|\\d)+$/",
|
||||
value: "allocateNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^\\d{12}$/",
|
||||
value: "orderNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^SR(\\w|\\d)+$/",
|
||||
value: "transferNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^\\d{12}-\\d{3}$/",
|
||||
value: "sendNo",
|
||||
},
|
||||
{
|
||||
regex: "/^PL\\d{10}$/",
|
||||
value: "wavePickingNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^PL\\d{10}-\\d{3}$/",
|
||||
value: "wavePickingGroupNumber",
|
||||
},
|
||||
{
|
||||
regex: "/^(\\w|\\d)*-[\\w|\\d]*-\\d*-[A-Z]-\\d*/",
|
||||
value: "location",
|
||||
},
|
||||
];
|
||||
},
|
||||
// 处理keyup事件
|
||||
handleKeyUp(e) {
|
||||
let gap = 0;
|
||||
if (this.keyupLastTime) {
|
||||
gap = new Date().getTime() - this.keyupLastTime;
|
||||
if (gap > 50) {
|
||||
gap = 0;
|
||||
this.realBarcode = "";
|
||||
}
|
||||
}
|
||||
this.keyupLastTime = new Date().getTime();
|
||||
// 输入法会触发keyup事件,key为Process,跳过即可
|
||||
if (e.key != "Process" && gap < 50) {
|
||||
if (e.key.trim().length == 1) {
|
||||
// 输入单个字母或者数字
|
||||
this.realBarcode += e.key;
|
||||
} else if (e.key.trim() == "Enter") {
|
||||
// 根据规则,判断barcode类型,返回数据(自定义规则)
|
||||
if (this.realBarcode) {
|
||||
let data = {
|
||||
type: this.barcodeRule(this.realBarcode),
|
||||
code: this.realBarcode,
|
||||
isLocal: this.isLocal(this.realBarcode),
|
||||
};
|
||||
this.$emit("handle", data);
|
||||
this.realBarcode = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 判断条码类型,如果没找到,则返回类型为barCode
|
||||
barcodeRule(barcode) {
|
||||
let value;
|
||||
this.regexRules.some((item, index) => {
|
||||
let regex = eval(item.regex);
|
||||
if (regex.test(barcode)) {
|
||||
value = item.value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return value ? value : "barCode";
|
||||
},
|
||||
// 根据条码是否包含门店名,判断是否本地条码
|
||||
isLocal(barcode) {
|
||||
return this.name ? barcode.indexOf(this.name) != -1 : undefined;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default { ...barcodeVue };
|
||||
</script>
|
||||
|
|
@ -1,24 +1,25 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-form label-position="top" :inline="true" class="popover">
|
||||
<el-select
|
||||
v-model="select"
|
||||
placeholder="请选择"
|
||||
class="dateselect"
|
||||
:size="size"
|
||||
@keydown.enter.native="Enter"
|
||||
<el-select
|
||||
v-model="select"
|
||||
placeholder="请选择"
|
||||
class="dateselect"
|
||||
:size="size"
|
||||
@keydown.enter.native="search"
|
||||
@change="changeText"
|
||||
>
|
||||
<template slot="prefix">
|
||||
{{ (PopUp.find((e) => e.enName == select) || {}).lable }}
|
||||
</template>
|
||||
<el-option
|
||||
v-for="item in PopUp"
|
||||
:key="item.enName"
|
||||
:label="item.lable"
|
||||
:value="item.enName"
|
||||
>
|
||||
<template slot="prefix">
|
||||
{{ (PopUp.find((e) => e.enName == select) || {}).lable }}
|
||||
</template>
|
||||
<el-option
|
||||
v-for="item in PopUp"
|
||||
:key="item.enName"
|
||||
:label="item.lable"
|
||||
:value="item.enName"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
<el-popover
|
||||
placement="bottom"
|
||||
|
@ -42,7 +43,7 @@
|
|||
</div>
|
||||
<div>
|
||||
<el-button size="mini" @click="clear">清空</el-button>
|
||||
<el-button size="mini" type="primary" plain @click="Enter"
|
||||
<el-button size="mini" type="primary" plain @click="search"
|
||||
>查询</el-button
|
||||
>
|
||||
</div>
|
||||
|
@ -54,7 +55,7 @@
|
|||
class="compound-input"
|
||||
:placeholder="placeholder"
|
||||
@input="changeText('value')"
|
||||
@keydown.enter.native="Enter"
|
||||
@keydown.enter.native="search"
|
||||
>
|
||||
<i
|
||||
slot="suffix"
|
||||
|
@ -71,14 +72,13 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name:'Compound',
|
||||
props: {
|
||||
size: {
|
||||
type: String,
|
||||
default: "small",
|
||||
},
|
||||
default: {
|
||||
default: "imei",
|
||||
default: null,
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
|
@ -102,21 +102,31 @@ export default {
|
|||
// 带弹出框
|
||||
PopUp() {
|
||||
if (!this.data) return;
|
||||
return this.data.filter((item) => item.isPopUp);
|
||||
let arr = [];
|
||||
arr = this.data.filter((item) => item.isPopUp && item.show);
|
||||
if (arr && arr.length) {
|
||||
arr.findIndex((e) => e.enName == this.select) == -1
|
||||
? this.$set(this, "select", arr[0].enName)
|
||||
: "";
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeText(mark) {
|
||||
const rep = /[^\s]+/g;
|
||||
let values = "";
|
||||
if (mark == "textarea") {
|
||||
this.value = "";
|
||||
values = this._.words(this.textarea, rep).join();
|
||||
} else {
|
||||
this.textarea = "";
|
||||
values = this.value;
|
||||
if (mark) {
|
||||
const rep = /[^\s]+/g;
|
||||
let values = "";
|
||||
if (mark == "textarea") {
|
||||
this.value = "";
|
||||
values = this._.words(this.textarea, rep).join();
|
||||
} else {
|
||||
this.textarea = "";
|
||||
values = this.value;
|
||||
}
|
||||
this.values = values;
|
||||
}
|
||||
this.values = values;
|
||||
this.$emit("CompoundSearch", this.select, this.values);
|
||||
},
|
||||
//弹出层
|
||||
eject() {
|
||||
|
@ -124,16 +134,19 @@ export default {
|
|||
},
|
||||
//清除
|
||||
clear() {
|
||||
this.$set(this, "textarea", "");
|
||||
this.$set(this, "value", "");
|
||||
this.$set(this, "values", "");
|
||||
this.disable = false;
|
||||
this.textarea = "";
|
||||
},
|
||||
//关闭弹出层
|
||||
close() {
|
||||
this.popBox = false;
|
||||
},
|
||||
//回车事件
|
||||
Enter() {
|
||||
console.log(this.select, this.values, "++++++this.value, imeisn");
|
||||
search() {
|
||||
this.close();
|
||||
this.$emit("SearchCompound");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ const idGen = () => {
|
|||
};
|
||||
|
||||
export default {
|
||||
name:'ErpEchart',
|
||||
name:'erp_echarts',
|
||||
props: {
|
||||
height: {
|
||||
type: String,
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
## ErpEcharts 图表封装
|
||||
> **组件名:ErpEcharts**
|
||||
> 代码块: `ErpEcharts`
|
||||
> 关联组件:`echarts`
|
||||
|
||||
> **子组件:传参**
|
||||
> options:组件接收的参数直接去echarts图表中复制option传到组件即可
|
||||
> width: "600px",----------------------------图表宽度(选填)
|
||||
> height: "400px",----------------------------图表高度(选填)
|
||||
|
||||
> **注意事项**
|
||||
> 循环多个图表时this.uuid必须为唯一值
|
|
@ -1,126 +0,0 @@
|
|||
## MoreClass 级联选择器弹出层
|
||||
> **组件名:MoreClass**
|
||||
> 代码块: `MoreClass`
|
||||
> 关联组件:`el-element`
|
||||
|
||||
> **子组件:传参**
|
||||
> data:组件接收的参数默认为[] 其中classifiable等于true的时候默认到该组件
|
||||
> lable: "分类",----------------------------输入框名称(选填)
|
||||
> type: "el-select",------------------------输入框类型(el-inpit,el-selec组件没用到但最好必填)
|
||||
> enName: "cate_id",------------------------返回值与model双向绑定(必填)
|
||||
> placeholder: "请选择机器类型",-------------输入框占位文本(选填)
|
||||
> size: "small",----------------------------输入框大小(选填)
|
||||
> show: true,-------------------------------是否展示(必填)
|
||||
> filterable: true,-------------------------是否可搜索(选填)
|
||||
> clearable: true,--------------------------是否可清除(选填)
|
||||
> classifiable: true,-----------------------是否分类,使用组件必填(必填)
|
||||
> disabled: false,--------------------------是否禁用(选填)
|
||||
> loading: false,---------------------------加载效果(选填)
|
||||
> options: [],------------------------------输入框下拉的值,父组件调用接口传递
|
||||
> formLabelAlign:组件返回的参数与v-model双向绑定{}
|
||||
> disabled:组件是否禁用默认false
|
||||
> size:组件大小默认值small
|
||||
> width:组件宽度默认450
|
||||
> Title:组件最外层占位文本默认为请选择分类/品牌/型号
|
||||
> **子组件:方法**
|
||||
> SearchClass:点击查询后直接父组件中打印formLabelAlign的值
|
||||
> ClearInput:父组件绑定ref直接调用子组件ClearInput()方法,然后子组件会给父组件抛出一个resetfrom()方法,在父组件resetfrom()中清空formLabelAlign中的邦定值
|
||||
> **父组件:方法**
|
||||
> getphonetype():父组件中获取第一条分类数据
|
||||
> SelectChange():选择数据后调用 后面是处理方法其中如果不是同一个接口resetFields中的值需要改变,后续代码也要修改
|
||||
SelectChange(item) {
|
||||
const resetFields = {
|
||||
cate_id: ["brand_id", "model_id", "color_id", "rom_id"],
|
||||
brand_id: ["model_id", "color_id", "rom_id"],
|
||||
model_id: ["color_id", "rom_id"],
|
||||
};
|
||||
|
||||
Object.entries(resetFields).forEach(([field, resetFields]) => {
|
||||
if (item.enName === field) {
|
||||
resetFields.forEach((field) => {
|
||||
this.formLabelAlign[field] = "";
|
||||
this.input.find((res) => res.enName === field).options = [];
|
||||
});
|
||||
}
|
||||
});
|
||||
/** 获取型号 颜色 容量*/
|
||||
if (item.enName == "cate_id" && this.formLabelAlign.cate_id != "") {
|
||||
this.getqualityinfo(
|
||||
{ cate_id: this.formLabelAlign.cate_id },
|
||||
1,
|
||||
"brand_id"
|
||||
);
|
||||
} else if (
|
||||
item.enName == "brand_id" &&
|
||||
this.formLabelAlign.brand_id != ""
|
||||
) {
|
||||
this.getqualityinfo(
|
||||
{
|
||||
cate_id: this.formLabelAlign.cate_id,
|
||||
brand_id: this.formLabelAlign.brand_id,
|
||||
},
|
||||
2,
|
||||
"model_id"
|
||||
);
|
||||
} else if (
|
||||
item.enName == "model_id" &&
|
||||
this.formLabelAlign.model_id != ""
|
||||
) {
|
||||
this.getqualityinfo(
|
||||
{
|
||||
cate_id: this.formLabelAlign.cate_id,
|
||||
brand_id: this.formLabelAlign.brand_id,
|
||||
model_id: this.formLabelAlign.model_id,
|
||||
},
|
||||
3,
|
||||
"color_id"
|
||||
);
|
||||
}
|
||||
},
|
||||
// 获取品牌,颜色,模型数据
|
||||
async getqualityinfo(data, val, itm) {
|
||||
this.input.forEach((item) => {
|
||||
if (item.enName == itm) {
|
||||
item.loading = true;
|
||||
}
|
||||
});
|
||||
try {
|
||||
const res = await cate_brand_list_in_stock(data);
|
||||
this.input.forEach((item) => {
|
||||
if (item.enName == itm) {
|
||||
item.loading = false;
|
||||
}
|
||||
});
|
||||
if (res.errcode !== 0) return;
|
||||
if (val == 1) {
|
||||
this.updateInputOptions("brand_id", res.datas);
|
||||
} else if (val == 2) {
|
||||
this.updateInputOptions("model_id", res.datas);
|
||||
} else {
|
||||
this.updateInputOptions("rom_id", res.datas.rom_list);
|
||||
this.updateInputOptions("color_id", res.datas.color_list);
|
||||
}
|
||||
} catch (error) {
|
||||
// 处理错误
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
处理数据
|
||||
updateInputOptions(enName, list) {
|
||||
const mappedList = Array.isArray(list)
|
||||
? list.map((item) => ({ label: item.label, value: item.value }))
|
||||
: [];
|
||||
this.input.forEach((r, i) => {
|
||||
if (r.enName === enName) {
|
||||
if (
|
||||
r.enName !== "model_id" &&
|
||||
r.enName !== "cate_id" &&
|
||||
r.enName !== "brand_id"
|
||||
) {
|
||||
this.input[i].show =
|
||||
Array.isArray(list) && list.length ? true : false;
|
||||
}
|
||||
this.input[i].options = mappedList;
|
||||
}
|
||||
});
|
||||
},
|
|
@ -1,4 +1,18 @@
|
|||
|
||||
<!-- 分类传值 -->
|
||||
<!-- input: [{
|
||||
lable: "分类",------------------------------------输入框名称(选填)
|
||||
type: "el-select",--------------------------------输入框类型(el-inpit,el-select组件没用到但最好必填)
|
||||
enName: "cate_id",--------------------------------返回值与model双向绑定(必填)
|
||||
placeholder: "请选择机器类型",---------------------输入框占位文本(选填)
|
||||
size: "small",------------------------------------输入框大小(选填)
|
||||
show: true,---------------------------------------是否展示(必填)
|
||||
filterable: true,---------------------------------是否可搜索(选填)
|
||||
clearable: true,----------------------------------是否可清除(选填)
|
||||
classifiable: true,-------------------------------是否分类,使用组件必填(必填)
|
||||
disabled: false,----------------------------------是否禁用(选填)
|
||||
loading: false,-----------------------------------加载效果(选填)
|
||||
options: [],--------------------------------------输入框下拉的值,父组件调用接口传递
|
||||
}] -->
|
||||
<template>
|
||||
<div class="machinemore">
|
||||
<el-popover
|
||||
|
@ -63,7 +77,6 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name:'MoreClass',
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<el-form-item
|
||||
:label="item.label"
|
||||
:prop="item.prop"
|
||||
v-show="item.show"
|
||||
v-if="item.MoreScreen"
|
||||
>
|
||||
<div
|
||||
:is="item.type"
|
||||
|
@ -36,6 +36,20 @@
|
|||
</el-option>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="item.show && item.Composite"
|
||||
:label="item.lable"
|
||||
:prop="item.prop"
|
||||
>
|
||||
<Composite
|
||||
:key="item.componentKey"
|
||||
:data="item.options"
|
||||
:default="item.default"
|
||||
:content="item.placeholder"
|
||||
:enName="item.enName"
|
||||
@CompositeVal="CompositeVal"
|
||||
></Composite>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -57,8 +71,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Composite from "@/components/CommonInput/Composite.vue";
|
||||
export default {
|
||||
name:'MoreScreen',
|
||||
props: {
|
||||
data: {
|
||||
default: () => {
|
||||
|
@ -72,7 +86,7 @@ export default {
|
|||
},
|
||||
},
|
||||
},
|
||||
components: {},
|
||||
components: { Composite },
|
||||
data() {
|
||||
return {
|
||||
visible: false, //更多筛选
|
||||
|
@ -81,7 +95,9 @@ export default {
|
|||
computed: {
|
||||
screenList() {
|
||||
if (!this.data) return;
|
||||
return this.data.filter((item) => item.MoreScreen);
|
||||
return this.data.filter(
|
||||
(item) => (item.MoreScreen || item.Composite) && item.show
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -98,13 +114,16 @@ export default {
|
|||
this.visible = false;
|
||||
this.$emit("search");
|
||||
},
|
||||
CompositeVal(val) {
|
||||
this.$emit("CompositeVal", val);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang='scss'>
|
||||
.morescreen{
|
||||
display: inline-block;
|
||||
.morescreen {
|
||||
display: inline-block;
|
||||
}
|
||||
.machinebox {
|
||||
.el-form-item {
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
## TimingModule 时间选择器
|
||||
> **组件名:TimingModule**
|
||||
> 代码块: `TimingModule`
|
||||
> 关联组件:`el-element`
|
||||
|
||||
> **子组件:传参**
|
||||
> data:组件接收的参数默认为[] 其中type等于el-date-picker的时候默认到该组件
|
||||
> lable: "分类名称",----------------------------输入框名称(必填)
|
||||
> type: "el-date-picker",------------------------输入框类型(el-date-picker必填)
|
||||
> TimeType:daterange(daterange为时间段date为当前时间)
|
||||
> enName: "time",------------------------返回值与model双向绑定(必填)
|
||||
> show: true,-------------------------------是否展示(必填)
|
||||
|
||||
|
||||
|
||||
> size:组件大小默认值small
|
||||
> default:默认参数
|
||||
> **子组件:方法**
|
||||
> getDateTime():子组件抛出一个getDateTime(a,b)接受两个参数a为下拉选择器的值,b为时间值
|
||||
> **注意事项**
|
||||
> 循环多个图表时this.uuid必须为唯一值
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="TimingModule">
|
||||
<div class="TimingModule" v-if="timer && timer.length">
|
||||
<el-select
|
||||
v-model="select"
|
||||
placeholder="请选择"
|
||||
|
@ -51,10 +51,9 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name:'TimingModule',
|
||||
props: {
|
||||
default: {
|
||||
default: null,
|
||||
default: "time",
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
|
@ -192,7 +191,16 @@ export default {
|
|||
computed: {
|
||||
timer() {
|
||||
if (!this.data) return;
|
||||
return this.data.filter((item) => item.type === "el-date-picker");
|
||||
let arr = [];
|
||||
arr = this.data.filter(
|
||||
(item) => item.type === "el-date-picker" && item.show
|
||||
);
|
||||
if (arr && arr.length) {
|
||||
arr.findIndex((e) => e.enName == this.select) == -1
|
||||
? this.$set(this, "select", arr[0].enName)
|
||||
: "";
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@ -206,7 +214,7 @@ export default {
|
|||
this.screen();
|
||||
},
|
||||
//选择日期
|
||||
timeChange(e) {
|
||||
timeChange() {
|
||||
this.screen();
|
||||
},
|
||||
//筛选满足条件的返回
|
||||
|
@ -215,14 +223,17 @@ export default {
|
|||
this.timer.find((e) => e.enName == this.select).TimeType == "daterange"
|
||||
) {
|
||||
this.$emit("getDateTime", this.select, this.DateTime);
|
||||
console.log(this.select, this.DateTime);
|
||||
} else if (
|
||||
this.timer.find((e) => e.enName == this.select).TimeType == "date"
|
||||
) {
|
||||
this.$emit("getDateTime", this.select, this.Time);
|
||||
console.log(this.select, this.Time);
|
||||
}
|
||||
},
|
||||
clear() {
|
||||
this.select = "";
|
||||
this.DateTime = "";
|
||||
this.Time = "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name:'appTitle',
|
||||
props: ["shoptitle"],
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
## Compound 多功能输入框(支持输入多组数据)
|
||||
> **组件名:Compound**
|
||||
> 代码块: `Compound`
|
||||
> 关联组件:`el-element`
|
||||
|
||||
> **子组件:传参**
|
||||
> data:组件接收的参数默认为[] 其中isPopUp等于true的时候默认到该组件
|
||||
> lable: "IMEI/SN/机器编号",----------------------------输入框名称(选填)
|
||||
> type: "el-select",------------------------输入框类型(必填)
|
||||
> enName: "cate_id",------------------------返回值与model双向绑定(必填)
|
||||
> size: "small",----------------------------输入框大小(选填)
|
||||
> show: true,-------------------------------是否展示(必填)
|
||||
> isPopUp: true,-----------------------是否分类,使用组件必填(必填)
|
||||
> default:组件默认值
|
||||
> size:组件大小默认值small
|
|
@ -1,12 +0,0 @@
|
|||
## selectbtn 多功能多选组件(仅筛选,多选,反选,模糊查询选择操作)
|
||||
> **组件名:SelectBtn**
|
||||
> 代码块: `selectbtn`
|
||||
> 关联组件:`el-element`
|
||||
|
||||
> **子组件:传参**
|
||||
> SourceData:组件接收的参数默认为[{label:'',value:''}] 接口的数据
|
||||
> dropdowntitle:组件占位文本
|
||||
> value:返回值的字段名如:value:"name_id" 则search中parmas的接收参数为{name_id:['返回的参数']},参数为必填
|
||||
> selectAll:默认false,是否全选
|
||||
> **子组件:方法**
|
||||
> search(params):params接收选择的参数
|
|
@ -71,7 +71,6 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name:'selectbtn',
|
||||
props: ["SourceData", "dropdowntitle", "value", "selectAll"],
|
||||
data() {
|
||||
return {
|
||||
|
@ -108,7 +107,7 @@ export default {
|
|||
//点击选择状态恢复到原始值
|
||||
checkeddown() {
|
||||
if (this.checkedList.length) {
|
||||
this.checkedList = this.selectvalue;
|
||||
this.checkedList =Object.assign([],this.selectvalue) ;
|
||||
} else {
|
||||
this.checkedList = [];
|
||||
}
|
||||
|
@ -239,7 +238,6 @@ export default {
|
|||
this.selectvalue = this.checkedList;
|
||||
this.valuelength = this.checkedList.length - 1;
|
||||
let params = { [this.value]: this.selectvalue };
|
||||
console.log(this.selectvalue.length, "测试params");
|
||||
this.cancel();
|
||||
this.$emit("search", params);
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "erp-element-ui",
|
||||
"version": "1.0.3",
|
||||
"version": "1.0.5",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue