| | |
| | | "version": "0.1.0", |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "serve": "vue-cli-service serve --open", |
| | | "build": "vue-cli-service build", |
| | | "lint": "vue-cli-service lint" |
| | | }, |
| | |
| | | } |
| | | } |
| | | |
| | | .border_radius_12{ |
| | | .border_radius_12 { |
| | | border-radius: 12px; |
| | | } |
| | | |
| | |
| | | <div class="search-list"> |
| | | <div class="search-top"> |
| | | <div class="left"> |
| | | <el-button v-if="showAdd" type="primary" size="mini" @click="addBtn">{{ |
| | | addTitle |
| | | }}</el-button> |
| | | <div |
| | | class="download" |
| | | v-if="showDownload" |
| | | @click="downloadClick" |
| | | :style="{ cursor: showDownload ? 'pointer' : 'no-drop' }" |
| | | > |
| | | <img |
| | | src="../../../public/images/download.png" |
| | | style="width: 13px" |
| | | alt="下载" |
| | | /> |
| | | </div> |
| | | <el-button v-if="showAdd" type="primary" size="mini" @click="addBtn"> |
| | | <div style="display: flex"> |
| | | <slot name="buttonIcon" /> |
| | | <span style="margin-top: 1px; line-height: 15px">{{ addTitle }}</span> |
| | | </div> |
| | | </el-button> |
| | | <slot name="leftButton" /> |
| | | <div |
| | | v-if="showDownload" |
| | | class="download" |
| | | @click="downloadClick" |
| | | :style="{ cursor: showDownload ? 'pointer' : 'no-drop' }" |
| | | > |
| | | <img src="@/assets/img/xiazai.png" style="width: 13px" /> |
| | | </div> |
| | | </div> |
| | | <div v-if="amountView" class="amount"> |
| | | <div |
| | | v-if="twoTotalAmount" |
| | | class="top_left" |
| | | style="width: 8%; border: 0" |
| | | > |
| | | <div v-if="twoTotalAmount" class="top_left" style="width: 8%; border: 0px"> |
| | | <dl> |
| | | <dd class="font_weight">{{ twoObject.value }}</dd> |
| | | <dd class="top_right_bottom">{{ twoObject.label }}</dd> |
| | |
| | | </dl> |
| | | </div> |
| | | <div class="top_right" style="width: 50%; margin-right: 15px"> |
| | | <dl v-for="item in otherOptions" :key="item.label"> |
| | | <dl v-for="item in otherOptions" :key="item.value"> |
| | | <dd class="font_weight"> |
| | | {{ item.value }} |
| | | </dd> |
| | | <dd class="top_right_bottom"> |
| | | <span |
| | | v-if="item.status" |
| | | class="Badge" |
| | | :class="item.status" |
| | | ></span> |
| | | <span v-if="item.status" class="Badge" :class="item.status"></span> |
| | | <span>{{ item.label }}</span> |
| | | </dd> |
| | | </dl> |
| | |
| | | <div class="search"> |
| | | <template v-if="isSearchForm"> |
| | | <el-input |
| | | :placeholder="placeholder" |
| | | v-model.trim="searchInput" |
| | | class="input-with-select" |
| | | style="width: 410px" |
| | | clearable |
| | | @change="searchClick" |
| | | @clear="clearClick" |
| | | :placeholder="placeholder" |
| | | v-model.trim="searchInput" |
| | | class="input-with-select" |
| | | style="width: 410px" |
| | | clearable |
| | | @change="searchClick" |
| | | @clear="clearClick" |
| | | > |
| | | <i |
| | | slot="suffix" |
| | | class="el-icon-search" |
| | | style="cursor: pointer" |
| | | @click="searchClick" |
| | | ></i> |
| | | <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> |
| | | </el-input> |
| | | </template> |
| | | <div class="search-Btn" v-if="showActionBtn"> |
| | | <div v-if="showScreen" class="search-Btn"> |
| | | <div class="common"> |
| | | <img |
| | | src="../../../public/images/filter.png" |
| | | style="width: 10px" |
| | | alt="筛选" |
| | | /> |
| | | <img src="@/assets/img/shaixuan.png" style="width: 10px" /> |
| | | <span>筛选</span> |
| | | </div> |
| | | <div class="common"> |
| | |
| | | </div> |
| | | </div> |
| | | <div v-if="showSet"> |
| | | <i |
| | | class="el-icon-setting cursor_pointer font_size_30" |
| | | style="color: rgb(128,128,128)" |
| | | @click="inspectionConfigClick" |
| | | ></i> |
| | | <i class="el-icon-setting cursor_pointer font_size_30" style="color: gray" @click="inspectionConfigClick"></i> |
| | | </div> |
| | | <div class="right"> |
| | | <slot name="rightButton"></slot> |
| | |
| | | props: { |
| | | showAdd: { |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | showDownload: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: false |
| | | }, |
| | | showActionBtn: { |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | placeholder: { |
| | | type: String, |
| | | default: "请输入内容", |
| | | default: "请输入内容" |
| | | }, |
| | | addTitle: { |
| | | type: String, |
| | | default: "添加", |
| | | default: "添加" |
| | | }, |
| | | totalObject: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | value: 0, |
| | | label: "全部物料", |
| | | }; |
| | | }, |
| | | label: "全部物料" |
| | | } |
| | | } |
| | | }, |
| | | otherOptions: { |
| | | type: Array, |
| | |
| | | { |
| | | value: 2, |
| | | label: "安全库存", |
| | | status: "success", |
| | | status: "success" |
| | | }, |
| | | { |
| | | value: 12, |
| | | label: "欠料", |
| | | status: "error", |
| | | status: "error" |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "安全库存", |
| | | status: "success", |
| | | status: "success" |
| | | }, |
| | | { |
| | | value: 12, |
| | | label: "欠料", |
| | | status: "error", |
| | | }, |
| | | ], |
| | | status: "error" |
| | | } |
| | | ] |
| | | }, |
| | | searchSel: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | value: "name", |
| | | label: "", |
| | | }; |
| | | }, |
| | | label: "" |
| | | } |
| | | } |
| | | }, |
| | | twoTotalAmount: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: false |
| | | }, |
| | | twoObject: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | value: 0, |
| | | label: "车间总量", |
| | | }; |
| | | }, |
| | | label: "车间总量" |
| | | } |
| | | } |
| | | }, |
| | | amountView: { |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | isSearchForm: { |
| | | type: Boolean, |
| | | default: true, |
| | | default: true |
| | | }, |
| | | showSet: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: false |
| | | }, |
| | | inputName: { |
| | | type: String, |
| | | default: "", |
| | | default: "" |
| | | }, |
| | | showScreen: { |
| | | type: Boolean, |
| | | default: true |
| | | } |
| | | }, |
| | | watch: { |
| | | inputName(val) { |
| | | this.searchInput = val; |
| | | }, |
| | | this.searchInput = val |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | searchInput: "", |
| | | searchSelValue: this.searchSel, |
| | | }; |
| | | searchSelValue: this.searchSel |
| | | } |
| | | }, |
| | | methods: { |
| | | // 搜索 |
| | | searchClick() { |
| | | this.$emit("searchClick", this.searchInput); |
| | | this.$emit("searchClick", this.searchInput) |
| | | }, |
| | | // 清除 |
| | | clearClick() { |
| | | this.$emit("clearClick", 1); |
| | | this.$emit("clearClick", 1) |
| | | }, |
| | | // 添加 |
| | | addBtn() { |
| | | this.$emit("addCommonClick"); |
| | | this.$emit("addCommonClick") |
| | | }, |
| | | // 下载 |
| | | downloadClick() { |
| | | this.$emit("downloadClick"); |
| | | this.$emit("downloadClick") |
| | | }, |
| | | // 模具-检查配置 |
| | | inspectionConfigClick() { |
| | | this.$emit("inspectionConfigClick"); |
| | | }, |
| | | }, |
| | | }; |
| | | this.$emit("inspectionConfigClick") |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | |
| | | .font_weight { |
| | | font-weight: 500; |
| | | font-size: 18px; |
| | | font-family: "DIN Alternate",serif; |
| | | font-family: "DIN Alternate", serif; |
| | | } |
| | | .top_right_bottom { |
| | | font-size: 12px; |
| | |
| | | .font_weight { |
| | | font-weight: 500; |
| | | font-size: 18px; |
| | | font-family: "DIN Alternate",serif; |
| | | font-family: "DIN Alternate", serif; |
| | | } |
| | | .top_right_bottom { |
| | | font-size: 12px; |
| | |
| | | <TableCommonView ref="tableListRef" :table-list="tableList" :select-box="false" @selCommonClick="selNameClick"> |
| | | </TableCommonView> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div> |
| | | <!-- <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div> --> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getProductListFromGrpc,getProductList } from "@/api/productManage/product" |
| | | import { getProductListFromGrpc, getProductList } from "@/api/productManage/product" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | |
| | | export default { |
| | | name: "EditSelCommonDialog", |
| | | mixins: [pageMixin], |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | |
| | | } |
| | | } |
| | | }, |
| | | sign:{ |
| | | type:String, |
| | | default:'' |
| | | sign: { |
| | | type: String, |
| | | default: "" |
| | | } |
| | | }, |
| | | components: {}, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | dialogWidth: "50%", |
| | | dialogWidth: "40%", |
| | | editConfig: this.editCommonConfig, |
| | | queryInput: "", |
| | | select: "全部字段", |
| | |
| | | search_map: {}, |
| | | searchSel: {}, |
| | | keyword: "", |
| | | keywordType: "" |
| | | keywordType: "", |
| | | showProductCol: ["产品名称", "产品编号"], |
| | | tableProductColumn: [ |
| | | { label: "产品名称", prop: "name", isClick: true }, |
| | | { label: "产品编号", prop: "number" } |
| | | ], |
| | | showCol: [], |
| | | tableColumn: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | setColumnVisible(showCol) { |
| | | return this.tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | setTable() { |
| | | if (this.editConfig.title === "产品名称") { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", isClick: true }, |
| | | { label: "产品编号", prop: "number" } |
| | | ] |
| | | } |
| | | this.searchSel = { value: "name", label: "产品名称" } |
| | | this.showCol = this.showProductCol |
| | | this.tableColumn = this.tableProductColumn |
| | | } |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectIndex: true, |
| | | highlight: true, |
| | | ref: "tableListRef", |
| | | showcol: this.showCol, |
| | | allcol: [], |
| | | tableColumn: this.setColumnVisible(this.showCol) |
| | | } |
| | | this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | const value = this.tableList.tableColumn[i].prop |
| | | this.searchOptions.push({ value: value, label: label }) |
| | | } |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | |
| | | }, |
| | | // 产品名称 |
| | | async getProductList() { |
| | | |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc; |
| | | await fn({ |
| | | page: 1, |
| | | pageSize: 100 |
| | | let fn = this.sign == "purchase" ? getProductList : getProductListFromGrpc |
| | | await fn({ |
| | | productName: this.keywordType === "产品名称" ? this.keyword : "", |
| | | productNumber: this.keywordType === "产品编号" ? this.keyword : "", |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | |
| | | ...item |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list.slice(0, 5) || [] |
| | | this.tableList.tableInfomation = list |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | } else { |
| | | this.tableList.tableInfomation = [] |
| | | } |
| | |
| | | cursor: pointer; |
| | | } |
| | | .dialog-footer { |
| | | height: 40px; |
| | | line-height: 40px; |
| | | height: 50px; |
| | | line-height: 50px; |
| | | color: red; |
| | | .btn-pager { |
| | | display: flex; |
| | | margin-top: 0px; |
| | | .page { |
| | | margin-left: auto; |
| | | } |
| | | } |
| | | } |
| | | ::v-deep { |
| | | .input-with-select .el-input-group__prepend { |
| | |
| | | if (this.editConfig.title === "添加") { |
| | | createProduct({ |
| | | list: this.tableData |
| | | }).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | }).catch(e=>{ |
| | | console.log(e) |
| | | }) |
| | | .then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功") |
| | | this.$parent.getProductList() |
| | | } |
| | | }) |
| | | .catch((e) => { |
| | | console.log(e) |
| | | }) |
| | | } else { |
| | | const params = this.saveParams() |
| | | updateProduct(params).then((res) => { |
| | |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true }, |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true, width: 250 }, |
| | | { label: "产品编码", prop: "number" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "规格型号", prop: "specifications" }, |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | dialogWidth: "60%", |
| | | dialogWidth: "50%", |
| | | editConfig: this.addCommonConfig, |
| | | rules: { |
| | | name: [{ required: true, message: "请输入", trigger: "blur" }], |
| | |
| | | .file-content { |
| | | display: flex; |
| | | } |
| | | } |
| | | .dialog-footer { |
| | | background-color: #f5f5f5; |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="filter"> |
| | | <div class="filter-card"> |
| | | <CommonSearch |
| | | :show-add="true" |
| | | add-title="新建" |
| | | @addCommonClick="addBtnClick" |
| | | :show-download="false" |
| | | :amount-view="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入供应商名称'" |
| | | @searchClick="onFilterSearch" |
| | | :show-add="true" |
| | | add-title="新建" |
| | | @addCommonClick="addBtnClick" |
| | | :show-download="true" |
| | | :amount-view="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入供应商名称'" |
| | | @searchClick="onFilterSearch" |
| | | /> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="body-card"> |
| | | <div class="list-view"> |
| | | <TableCommonView |
| | | ref="tableSupplier" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @tableRowClick="tableRowClick" |
| | | @selTableCol="selTableCol" |
| | | ref="tableSupplier" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @tableRowClick="tableRowClick" |
| | | @selTableCol="selTableCol" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | v-if="scope.row.status === 0" |
| | | @click="enableClick(scope.row, '启用')" |
| | | type="text" |
| | | size="small" |
| | | >启用</el-button |
| | | v-if="scope.row.status === 0" |
| | | @click="enableClick(scope.row, '启用')" |
| | | type="text" |
| | | size="small" |
| | | >启用</el-button |
| | | > |
| | | <el-button v-else @click="enableClick(scope.row, '停用')" type="text" size="small">停用</el-button> |
| | | <el-button @click="modifyClick(scope.row)" type="text" size="small">修改</el-button> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="simple-filter"> |
| | | <div class="simple-filter-card"> |
| | | <CommonSearch |
| | | :show-add="false" |
| | | :show-download="false" |
| | | :amount-view="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入产品名称'" |
| | | @searchClick="onProductFilterSearch" |
| | | :show-add="false" |
| | | :show-download="false" |
| | | :amount-view="false" |
| | | :show-screen="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入产品名称'" |
| | | @searchClick="onProductFilterSearch" |
| | | > |
| | | <template slot="leftButton"> |
| | | <div class="sub-title"><span class="sub-title-decorator"></span>可提供的产品</div> |
| | |
| | | <div class="body-card"> |
| | | <div class="list-view"> |
| | | <TableCommonView |
| | | ref="tableListProduct" |
| | | :table-list="productTableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | @selTableCol="selProductTableCol" |
| | | ref="tableListProduct" |
| | | :table-list="productTableList" |
| | | @selCommonClick="selCommonClick" |
| | | @getSelectArray="getSelectArray" |
| | | @selTableCol="selProductTableCol" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="170"> |
| | |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView |
| | | class="page" |
| | | :pager-options="productPagerOptions" |
| | | @size-change="productChangeHandler" |
| | | @current-change="currentProductHandler" |
| | | class="page" |
| | | :pager-options="productPagerOptions" |
| | | @size-change="productChangeHandler" |
| | | @current-change="currentProductHandler" |
| | | /> |
| | | </div> |
| | | </div> |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | searchSupplierName: '', |
| | | searchSupplierName: "", |
| | | tableList: {}, // 供应商列表 |
| | | productTableList: {}, // 产品列表 |
| | | selValueList: [], |
| | |
| | | totalCount: 0 |
| | | }, |
| | | supplierId: 0, |
| | | showCol:['供应商编号','供应商名称','供应商类型','所属行业','联系人','联系电话','状态'], |
| | | showCol: ["供应商编号", "供应商名称", "供应商类型", "所属行业", "联系人", "联系电话", "状态"], |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "name", min: 130, default: true }, |
| | |
| | | { label: "状态", prop: "status_name", min: 130 }, |
| | | { label: "创建时间", prop: "created_at", min: 130 } |
| | | ], |
| | | showProductCol:['产品编码','产品名称','产品规格','单位','采购价格','供货时长(天)','物流时长(天)'], |
| | | productColumn:[ |
| | | showProductCol: ["产品编码", "产品名称", "产品规格", "单位", "采购价格", "供货时长(天)", "物流时长(天)"], |
| | | productColumn: [ |
| | | { label: "产品编码", prop: "number", min: 190 }, |
| | | { label: "产品名称", prop: "name", min: 130, default: true }, |
| | | { label: "产品规格", prop: "specifications", min: 130 }, |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | setColumnVisible(showCol){ |
| | | return this.tableColumn.map(ele=>{ |
| | | setColumnVisible(showCol) { |
| | | return this.tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | setProductColumnVisible(showCol){ |
| | | return this.productColumn.map(ele=>{ |
| | | setProductColumnVisible(showCol) { |
| | | return this.productColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn:showCol.includes(ele.label) |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | ref: "tableListRef", |
| | | showcol: this.showCol, |
| | | allcol: [], |
| | | tableColumn: this.setColumnVisible(this.showCol), |
| | | tableColumn: this.setColumnVisible(this.showCol) |
| | | } |
| | | this.tableList.allcol = this.tableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label); |
| | | this.tableList.allcol = this.tableList.tableColumn.filter((ele) => !ele.default).map((ele) => ele.label) |
| | | |
| | | this.searchOptions = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | |
| | | } |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val); |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | }, |
| | | setProductTable() { |
| | | this.productTableList = { |
| | |
| | | selectIndex: true, |
| | | showcol: this.showProductCol, |
| | | allcol: [], |
| | | tableColumn: this.setProductColumnVisible(this.showProductCol), |
| | | tableColumn: this.setProductColumnVisible(this.showProductCol) |
| | | } |
| | | this.searchProductOptions = [] |
| | | for (let i = 0; i < this.productTableList.tableColumn.length; i++) { |
| | |
| | | this.searchProductOptions.push({ value: value, label: label }) |
| | | } |
| | | |
| | | this.productTableList.allcol = this.productTableList.tableColumn.filter(ele=>!ele.default).map(ele=>ele.label); |
| | | console.log('this.productTableList',this.productTableList) |
| | | this.productTableList.allcol = this.productTableList.tableColumn |
| | | .filter((ele) => !ele.default) |
| | | .map((ele) => ele.label) |
| | | console.log("this.productTableList", this.productTableList) |
| | | }, |
| | | selProductTableCol(val) { |
| | | this.showProductCol = val; |
| | | this.productTableList.tableColumn = this.setProductColumnVisible(val); |
| | | this.showProductCol = val |
| | | this.productTableList.tableColumn = this.setProductColumnVisible(val) |
| | | }, |
| | | // 请求数据 |
| | | getData() { |
| | |
| | | }) |
| | | |
| | | // 重新获取供应商列表后应该重置产品列表页码 |
| | | this.productPagerOptions.currPage = 1; |
| | | this.productPagerOptions.currPage = 1 |
| | | // 如果供应商列表为空,则可提供产品列表也应为空 |
| | | if (list.length){ |
| | | if (list.length) { |
| | | this.getProductList() |
| | | }else { |
| | | this.productTableList.tableInfomation=[] |
| | | this.productPagerOptions.currPage = 1; |
| | | } else { |
| | | this.productTableList.tableInfomation = [] |
| | | this.productPagerOptions.currPage = 1 |
| | | this.productPagerOptions.totalCount = 0 |
| | | } |
| | | } |
| | |
| | | }) |
| | | }, |
| | | // 搜索供应商 |
| | | onFilterSearch(searchText){ |
| | | this.searchSupplierName = searchText ??'' |
| | | onFilterSearch(searchText) { |
| | | this.searchSupplierName = searchText ?? "" |
| | | this.pagerOptions.currPage = 1 |
| | | this.getSupplierList() |
| | | }, |
| | | // 搜索产品 |
| | | onProductFilterSearch(searchText){ |
| | | onProductFilterSearch(searchText) { |
| | | this.productPagerOptions.currPage = 1 |
| | | this.getProductList('name', searchText) |
| | | this.getProductList("name", searchText) |
| | | }, |
| | | // 新建供应商 |
| | | addBtnClick() { |
| | |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .supplier{ |
| | | .supplier { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | .top{ |
| | | .top { |
| | | position: relative; |
| | | height: 55%; |
| | | .body{ |
| | | .body { |
| | | position: relative; |
| | | height: calc(100% - 92px); |
| | | } |
| | | } |
| | | .bottom{ |
| | | .bottom { |
| | | position: relative; |
| | | height: 45%; |
| | | .body{ |
| | | .body { |
| | | position: relative; |
| | | height: calc(100% - 40px); |
| | | padding-top: 0; |
| | | } |
| | | } |
| | | .filter{ |
| | | .filter { |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 12px 20px 0 20px; |
| | | &-card{ |
| | | &-card { |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | background-color: #fff; |
| | | } |
| | | } |
| | | .simple-filter{ |
| | | .simple-filter { |
| | | height: 40px; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | align-items: center; |
| | | padding: 0 20px; |
| | | &-card{ |
| | | &-card { |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | |
| | | flex: 1; |
| | | } |
| | | } |
| | | .body{ |
| | | .body { |
| | | box-sizing: border-box; |
| | | padding: 10px 20px; |
| | | border-radius: 12px; |
| | |
| | | } |
| | | } |
| | | } |
| | | .sub-title{ |
| | | .sub-title { |
| | | flex-shrink: 0; |
| | | margin-right: 20px; |
| | | font-size: 16px; |
| | |
| | | line-height: 28px; |
| | | position: relative; |
| | | padding-left: 12px; |
| | | &-decorator{ |
| | | &-decorator { |
| | | position: absolute; |
| | | height: 100%; |
| | | width: 4px; |
| | |
| | | left: 0; |
| | | } |
| | | } |
| | | |
| | | </style> |