|
|
@@ -15,12 +15,135 @@
|
|
|
:show-close="false"
|
|
|
@close="onClose">
|
|
|
<div class="drawer__panel" style="margin-bottom: 0 !important;">
|
|
|
- <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
|
|
|
+ <div class="flex-between" v-if="drawerTitle == '自产品档案添加'">
|
|
|
+ <el-select
|
|
|
+ v-model="where.sa_brandid"
|
|
|
+ :placeholder="$t(`选择品牌`)"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ class="inline-24"
|
|
|
+ @change="brandChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.brands"
|
|
|
+ :key="item.sa_brandid"
|
|
|
+ :label="$t(item.brandname)"
|
|
|
+ :value="item.sa_brandid"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-cascader
|
|
|
+ :placeholder="$t(`选择分类`)"
|
|
|
+ size="small"
|
|
|
+ v-model="itemclassid"
|
|
|
+ :options="options.itemclass"
|
|
|
+ :props="{
|
|
|
+ checkStrictly: true,
|
|
|
+ children: 'subdep',
|
|
|
+ label: 'itemclassname',
|
|
|
+ value: 'itemclassid',
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ @change="classChange"
|
|
|
+ ></el-cascader>
|
|
|
+ </div>
|
|
|
+ <div class="top-margin" v-if="drawerTitle == '自产品档案添加'">
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ :type="selectList.length == 0?'':'primary'"
|
|
|
+ :loading="loading"
|
|
|
+ @click="onSubmit"
|
|
|
+ class="normal-btn-width inline-24"
|
|
|
+ :disabled="selectList.length == 0"
|
|
|
+ >{{ $t("添加选中商品") }}</el-button
|
|
|
+ >
|
|
|
+ <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
|
|
|
+ v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)"
|
|
|
+ size="small" class="input-with-select inline-24 layout_search__panel" clearable>
|
|
|
+ </el-input>
|
|
|
+ <el-select
|
|
|
+ v-model="where.standards"
|
|
|
+ :placeholder="$t(`选择标准`)"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ class="inline-24 bottom-margin"
|
|
|
+ @change="selectChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.itemstandards"
|
|
|
+ :key="item.value"
|
|
|
+ :label="$t(item.value)"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ $t(item.value) }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{
|
|
|
+ item.remarks ? $t(item.remarks) : $t("暂无描述")
|
|
|
+ }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="where.material"
|
|
|
+ :placeholder="$t(`选择材质`)"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ class="inline-24 bottom-margin"
|
|
|
+ @change="selectChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options.itemmaterials"
|
|
|
+ :key="item.value"
|
|
|
+ :label="$t(item.value)"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ $t(item.value) }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 12px">{{
|
|
|
+ item.remarks ? $t(item.remarks) : $t("暂无描述")
|
|
|
+ }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-input
|
|
|
+ style="width: 200px"
|
|
|
+ :placeholder="$t(`型号`)"
|
|
|
+ :suffix-icon="
|
|
|
+ where.model
|
|
|
+ ? where.model.length > 0
|
|
|
+ ? ''
|
|
|
+ : ''
|
|
|
+ : 'el-icon-search'
|
|
|
+ "
|
|
|
+ v-model="where.model"
|
|
|
+ @keyup.native.enter="selectChange"
|
|
|
+ @clear="selectChange"
|
|
|
+ size="small"
|
|
|
+ class="bottom-margin input-with-select inline-24 layout_search__panel"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-input
|
|
|
+ style="width: 200px"
|
|
|
+ :placeholder="$t(`规格`)"
|
|
|
+ :suffix-icon="
|
|
|
+ where.spec
|
|
|
+ ? where.spec.length > 0
|
|
|
+ ? ''
|
|
|
+ : ''
|
|
|
+ : 'el-icon-search'
|
|
|
+ "
|
|
|
+ v-model="where.spec"
|
|
|
+ @keyup.native.enter="selectChange"
|
|
|
+ @clear="selectChange"
|
|
|
+ size="small"
|
|
|
+ class="bottom-margin input-with-select inline-24 layout_search__panel"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ <el-input v-else style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
|
|
|
v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)"
|
|
|
- size="small" class="input-with-select inline-16 layout_search__panel" clearable>
|
|
|
+ size="small" class="input-with-select inline-24 layout_search__panel" clearable>
|
|
|
</el-input>
|
|
|
<table-detail :layout="tablecols" :checkbox="true" :data="list" :custom="true" :width="true" :height="tableHieght" minHeight="200px" fixedName="operation"
|
|
|
- @selectionChange="selectionChange" style="margin-top: 10px">
|
|
|
+ @selectionChange="selectionChange" >
|
|
|
<template v-slot:customcol="scope">
|
|
|
<div v-if="scope.column.columnname == 'nominalpressure'">
|
|
|
{{tool.nominalPressureSet(scope.column.data[[scope.column.columnname]])}}
|
|
|
@@ -71,12 +194,32 @@ export default {
|
|
|
data(){
|
|
|
return {
|
|
|
drawerVisible:false,
|
|
|
- tableHieght:'calc(100vh - 240px)',
|
|
|
+ tableHieght:this.drawerTitle == '自产品档案添加'?'calc(100vh - 300px)':'calc(100vh - 240px)',
|
|
|
list:[],
|
|
|
currentPage:0,
|
|
|
total:0,
|
|
|
loading:false,
|
|
|
- selectList:[]
|
|
|
+ selectList:[],
|
|
|
+ sa_brandid:"",
|
|
|
+ itemclassid: "",
|
|
|
+ itemstandard: "",
|
|
|
+ itemmaterial: "",
|
|
|
+ options: {
|
|
|
+ brands: [],
|
|
|
+ itemclass: [],
|
|
|
+ itemstandards: [],
|
|
|
+ itemmaterials: [],
|
|
|
+ },
|
|
|
+ where:{
|
|
|
+ "condition": "",
|
|
|
+ "sa_brandid": "",
|
|
|
+ "itemclassid":"",
|
|
|
+ "standards": "",
|
|
|
+ "material": "",
|
|
|
+ "spec":"",
|
|
|
+ "model":"",
|
|
|
+ "tradefield":""
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
@@ -84,6 +227,13 @@ export default {
|
|
|
this.drawerVisible = true
|
|
|
this.selectList = []
|
|
|
this.listData(this.param.content.pageNumber = 1)
|
|
|
+ this.queryBrands()
|
|
|
+ this.$store.dispatch("optiontypeselect", "itemstandards").then((res) => {
|
|
|
+ this.options.itemstandards = res.data;
|
|
|
+ });
|
|
|
+ this.$store.dispatch("optiontypeselect", "itemmaterial").then((res) => {
|
|
|
+ this.options.itemmaterials = res.data;
|
|
|
+ });
|
|
|
},
|
|
|
async listData(){
|
|
|
const res = await this.$api.requested(this.param)
|
|
|
@@ -133,12 +283,127 @@ export default {
|
|
|
this.$emit('addSuccess')
|
|
|
}
|
|
|
},
|
|
|
- onClose(){}
|
|
|
+ brandChange(){
|
|
|
+ this.selectChange()
|
|
|
+ this.queryClass()
|
|
|
+ },
|
|
|
+ /*获取品牌*/
|
|
|
+ async queryBrands() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "20220924163702",
|
|
|
+ content: {
|
|
|
+ pageSize: 1000,
|
|
|
+ where: {
|
|
|
+ condition: "",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ });
|
|
|
+ this.options.brands = res.data;
|
|
|
+ console.log("获取品牌", res.data);
|
|
|
+ },
|
|
|
+ /*获取分类*/
|
|
|
+ async queryClass() {
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ id: "20220922110403",
|
|
|
+ content: {
|
|
|
+ sa_brandid: this.where.sa_brandid !== "" ? this.where.sa_brandid : 0,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ let arr = [];
|
|
|
+ function converTree(node) {
|
|
|
+ var elNode = {
|
|
|
+ isdeep: node["isdeep"],
|
|
|
+ ishide: node["ishide"],
|
|
|
+ istool: node["istool"],
|
|
|
+ itemclassfullname: node["itemclassfullname"],
|
|
|
+ itemclassfullnum: node["itemclassfullnum"],
|
|
|
+ itemclassid: node["itemclassid"],
|
|
|
+ itemclassname: node["itemclassname"],
|
|
|
+ itemclassnum: node["itemclassnum"],
|
|
|
+ num: node["num"],
|
|
|
+ parentid: node["parentid"],
|
|
|
+ rowindex: node["rowindex"],
|
|
|
+ subdep: [],
|
|
|
+ };
|
|
|
+ if (node.subdep.length > 0) {
|
|
|
+ // 如果存在子节点
|
|
|
+ for (var index = 0; index < node.subdep.length; index++) {
|
|
|
+ // 遍历子节点, 把每个子节点看做一颗独立的树, 传入递归构造子树, 并把结果放回到新node的children中
|
|
|
+ elNode.subdep.push(converTree(node.subdep[index]));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ elNode = {
|
|
|
+ isdeep: node["isdeep"],
|
|
|
+ ishide: node["ishide"],
|
|
|
+ istool: node["istool"],
|
|
|
+ itemclassfullname: node["itemclassfullname"],
|
|
|
+ itemclassfullnum: node["itemclassfullnum"],
|
|
|
+ itemclassid: node["itemclassid"],
|
|
|
+ itemclassname: node["itemclassname"],
|
|
|
+ itemclassnum: node["itemclassnum"],
|
|
|
+ num: node["num"],
|
|
|
+ parentid: node["parentid"],
|
|
|
+ rowindex: node["rowindex"],
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return elNode;
|
|
|
+ }
|
|
|
+ // this.options.itemclass = arr
|
|
|
+ res.data[0].ttemclass.forEach((e) => {
|
|
|
+ arr.push(converTree(e));
|
|
|
+ });
|
|
|
+
|
|
|
+ this.options.itemclass = arr;
|
|
|
+ return arr;
|
|
|
+ },
|
|
|
+ classChange(){
|
|
|
+ this.where.itemclassid = this.itemclassid[this.itemclassid.length -1]
|
|
|
+ this.selectChange()
|
|
|
+ },
|
|
|
+ selectChange(){
|
|
|
+ this.param.content.where = this.where
|
|
|
+ this.listData(this.param.content.pageNumber = 1)
|
|
|
+ },
|
|
|
+ onClose(){
|
|
|
+ this.sa_brandid = ''
|
|
|
+ this.itemclassid = ''
|
|
|
+ this.where = {
|
|
|
+ "condition": "",
|
|
|
+ "sa_brandid": "",
|
|
|
+ "itemclassid":"",
|
|
|
+ "standards": "",
|
|
|
+ "material": "",
|
|
|
+ "spec":"",
|
|
|
+ "model":"",
|
|
|
+ "tradefield":""
|
|
|
+ }
|
|
|
+ this.selectList = []
|
|
|
+ this.selectChange()
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-
|
|
|
+.image {
|
|
|
+ height: 38px;
|
|
|
+ width: 38px;
|
|
|
+ margin-top: 0;
|
|
|
+}
|
|
|
+.top-margin {
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
+.bottom-margin {
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+/deep/ input::-webkit-input-placeholder {
|
|
|
+ color: #58585d;
|
|
|
+}
|
|
|
+/deep/ input::-moz-input-placeholder {
|
|
|
+ color: #58585d;
|
|
|
+}
|
|
|
+/deep/ input::-ms-input-placeholder {
|
|
|
+ color: #58585d;
|
|
|
+}
|
|
|
</style>
|