Merge branch 'xiaozy_产品列表' of http://121.196.213.68:3000/xiaozhiyong/refinery-admin into lixuan

pull/1/head
lixuan 2 years ago
commit 1ccc6803e7
  1. 77
      src/components/autocomplete/index.vue
  2. 9
      src/views/product/components/add.vue
  3. 5
      src/views/product/components/create.vue
  4. 5
      src/views/product/index.vue
  5. 5
      src/views/refineryAccount/components/add.vue
  6. 5
      src/views/refineryAccount/index.vue
  7. 5
      src/views/refineryInfo/index.vue

@ -1,5 +1,5 @@
<template>
<el-autocomplete
<!-- <el-autocomplete
v-model="text"
:fetch-suggestions="querySearchAsync"
:value-key="config.valueKey"
@ -7,7 +7,26 @@
clearable
@select="selectAutocomplete"
@clear="params[config.querykey] = ''"
></el-autocomplete>
></el-autocomplete> -->
<el-select
v-model="params[config.querykey]"
filterable
remote
clearable
reserve-keyword
:placeholder="config.placeholder"
:remote-method="remoteMethod"
@clear="list = []"
>
<el-option
v-for="(item, index) in list"
:key="item.id + index"
:label="item[config.labelKey]"
:value="item[config.valueKey]"
>
</el-option>
</el-select>
</template>
<script>
@ -17,37 +36,67 @@ export default {
config: Object,
// config: {
// serveTarget: {}, //
// autocomplateKey: "", //
// autocompleteKey: "", //
// labelKey: "", //label
// valueKey: "", //
// querykey: "", //
// },
},
data() {
return {
text: "",
list: [],
};
},
created() {
console.log("params", this.params);
watch: {
"config.echoId": {
handler(nval, oval) {
if (nval) {
console.log(nval);
this.remoteMethod(this.config.echoName);
}
},
deep: true,
immediate: true,
},
},
methods: {
//
querySearchAsync(queryString, cb) {
if (queryString) {
remoteMethod(query) {
if (query !== "") {
this.loading = true;
let params = {};
params[this.config.autocompleteKey] = queryString;
params[this.config.autocompleteKey] = query;
this.config.serveTarget(params).then((res) => {
let timeInstance = setTimeout(() => {
this.loading = false;
clearTimeout(timeInstance);
if (res.data.length) {
cb(res.data);
} else cb([]);
this.list = res.data;
} else this.list = [];
}, 1000 * Math.random());
});
} else cb([]);
},
selectAutocomplete(item) {
this.params[this.config.querykey] = item.id;
} else {
this.list = [];
}
},
// querySearchAsync(queryString, cb) {
// if (queryString) {
// let params = {};
// params[this.config.autocompleteKey] = queryString;
// this.config.serveTarget(params).then((res) => {
// let timeInstance = setTimeout(() => {
// clearTimeout(timeInstance);
// if (res.data.length) {
// cb(res.data);
// } else cb([]);
// }, 1000 * Math.random());
// });
// } else cb([]);
// },
// selectAutocomplete(item) {
// this.params[this.config.querykey] = item.id;
// },
},
};
</script>

@ -110,10 +110,13 @@ export default {
refineryList: [],
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocomplateKey: "refineryName",
valueKey: "refineryName",
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
echoId: "",
echoName: "",
},
productTypeList: [
{
@ -170,6 +173,8 @@ export default {
if (id) {
//
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName;
console.log("this.form", this.form.floorPrice);
}
},

@ -136,8 +136,9 @@ export default {
refineryList: [],
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocomplateKey: "refineryName",
valueKey: "refineryName",
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
},

@ -224,8 +224,9 @@ export default {
},
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocomplateKey: "refineryName",
valueKey: "refineryName",
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
},

@ -70,8 +70,9 @@ export default {
refineryList: [],
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocomplateKey: "refineryName",
valueKey: "refineryName",
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
},

@ -162,8 +162,9 @@ export default {
},
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocomplateKey: "refineryName",
valueKey: "refineryName",
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
},

@ -189,8 +189,9 @@ export default {
},
configAutocomplete: {
serveTarget: serve.findByEntity,
autocomplateKey: "refineryName",
valueKey: "refineryName",
autocompleteKey: "refineryName",
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",
querykey: "refineryId",
},

Loading…
Cancel
Save