| | |
| | | .el-drawer__wrapper { |
| | | z-index: 9999 !important; |
| | | } |
| | | // 颜色 |
| | | .el-table .onSelect { |
| | | background: #ebf2ff; |
| | | } |
| | |
| | | <span>采购管理</span> |
| | | </template> |
| | | <el-menu-item index="/purchaseManage/purchase">采购订单</el-menu-item> |
| | | <el-menu-item index="/purchaseManage/quality">采购质检单</el-menu-item> |
| | | <!-- <el-menu-item index="/purchaseManage/quality">采购质检单</el-menu-item> --> |
| | | <!-- <el-menu-item index="/purchaseManage/warehouse">采购入库单</el-menu-item> --> |
| | | <el-menu-item index="/purchaseManage/returned">采购退货单</el-menu-item> |
| | | <!-- <el-menu-item index="/purchaseManage/returned">采购退货单</el-menu-item> --> |
| | | </el-submenu> |
| | | <el-submenu index="3"> |
| | | <template slot="title"> |
| | |
| | | :lazy="tableList.lazy" |
| | | size="mini" |
| | | @selection-change="handleSelectionChange" |
| | | :header-cell-style="{ background: '#f1f3f8', color: '#000009' , 'font-size': '14px'}" |
| | | :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '14px' }" |
| | | :highlight-current-row="tableList.highlight" |
| | | :row-class-name="tableRowClassName" |
| | | @row-click="tableRowClick" |
| | |
| | | :tree-props="{ children: 'child', hasChildren: 'hasChildren' }" |
| | | > |
| | | <el-table-column align="center" v-if="tableList.selectBox" type="selection" width="40"> </el-table-column> |
| | | <el-table-column align="center" v-if="tableList.selectIndex" type="index" label="序号" width="50"> </el-table-column> |
| | | <el-table-column align="center" v-if="tableList.selectIndex" type="index" label="序号" width="50"> |
| | | </el-table-column> |
| | | <template v-for="(item, i) in tableList.tableColumn"> |
| | | <el-table-column |
| | | align="center" |
| | |
| | | <span v-if="item.price">{{ "¥" + number_format(scope.row[item.prop], 2, ".", ",") }}</span> |
| | | <div v-else-if="item.status" :class="scope.row.status">{{ scope.row[item.prop] }}</div> |
| | | <span v-else-if="item.isTime">{{ |
| | | dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) === "1900-01-01 00:06:26" |
| | | ? "--" |
| | | : dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) |
| | | }}</span> |
| | | <span v-else-if="item.isClick && scope.row[item.prop]" class="sel-name" @click="selCommonClick(scope.row)">{{ |
| | | scope.row[item.prop] |
| | | }}</span> |
| | | dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) === "1900-01-01 00:06:26" |
| | | ? "--" |
| | | : dateFormat("YYYY-mm-dd HH:MM:SS", scope.row[item.prop]) |
| | | }}</span> |
| | | <span |
| | | v-else-if="item.isClick && scope.row[item.prop]" |
| | | class="sel-name" |
| | | @click="selCommonClick(scope.row)" |
| | | >{{ scope.row[item.prop] }}</span |
| | | > |
| | | <span v-else-if="item.isFirst">{{ scope.row[item.prop] ? "是" : "否" }}</span> |
| | | <span |
| | | v-else-if="item.isCommonClick && scope.row[item.prop]" |
| | | class="sel-name" |
| | | @click="selCommonClick(scope.row)" |
| | | >{{ scope.row[item.prop] }}</span |
| | | v-else-if="item.isCommonClick && scope.row[item.prop]" |
| | | class="sel-name" |
| | | @click="selCommonClick(scope.row)" |
| | | >{{ scope.row[item.prop] }}</span |
| | | > |
| | | <div v-else-if="item.isProductName" class="product-view"> |
| | | <ul v-if="scope.row.products && scope.row.products.length > 0"> |
| | |
| | | <div class="overSpread1" v-show="iscolopen" @click="onMaskClick"></div> |
| | | <div class="styleBtn"> |
| | | <i @click="checkCol()" class="label">...</i> |
| | | <el-checkbox-group |
| | | v-model="showcol" |
| | | v-show="iscolopen" |
| | | class="checkbox-group" |
| | | @change="selectCheckBoxList" |
| | | > |
| | | <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item" |
| | | >{{ item }} |
| | | </el-checkbox> |
| | | <el-checkbox-group v-model="showcol" v-show="iscolopen" class="checkbox-group" @change="selectCheckBoxList"> |
| | | <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item">{{ item }} </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | </div> |
| | |
| | | data() { |
| | | return { |
| | | iscolopen: false, |
| | | showcol:[] |
| | | showcol: [] |
| | | } |
| | | }, |
| | | watch: { |
| | | 'tableList.showcol':{ |
| | | handler(newVal){ |
| | | this.showcol=newVal |
| | | "tableList.showcol": { |
| | | handler(newVal) { |
| | | this.showcol = newVal |
| | | }, |
| | | immediate:true |
| | | immediate: true |
| | | } |
| | | }, |
| | | computed: {}, |
| | | methods: { |
| | | onMaskClick() { |
| | | this.iscolopen = false; |
| | | this.iscolopen = false |
| | | }, |
| | | checkCol() { |
| | | this.iscolopen = !this.iscolopen; |
| | | this.iscolopen = !this.iscolopen |
| | | }, |
| | | selectCheckBoxList(val) { |
| | | this.$emit("selTableCol", val); |
| | | this.$emit("selTableCol", val) |
| | | }, |
| | | handleReserve(row) { |
| | | return row._id ? row._id : row.id |
| | |
| | | selCommonClick(row) { |
| | | this.$emit("selCommonClick", row) |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row, column, event) { |
| | | this.$emit("tableRowClick", row, column, event) |
| | | }, |
| | | // 单选行相关 |
| | | tableRowClassName({ row }) { |
| | | if (Object.keys(this.selectClassRow).length > 0) { |
| | |
| | | } |
| | | } |
| | | this.$emit("tableRowClassName", row) |
| | | }, |
| | | tableRowClick(row) { |
| | | this.$emit("tableRowClick", row) |
| | | } |
| | | } |
| | | } |
| | |
| | | text-align: center; |
| | | } |
| | | |
| | | ::v-deep{ |
| | | .el-table .cell .el-button--text.el-button--small{ |
| | | ::v-deep { |
| | | .el-table .cell .el-button--text.el-button--small { |
| | | padding: 4px 0; |
| | | } |
| | | } |
| | |
| | | > |
| | | </TableCommonView> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | |
| | | <script> |
| | | import { getSupplierList } from "@/api/supplierManage/supplier" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | |
| | | export default { |
| | | name: "EditSelClientDialog", |
| | | mixins: [pageMixin], |
| | | props: { |
| | | editCommonConfig: { |
| | | type: Object, |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | dialogWidth: "50%", |
| | | dialogWidth: "40%", |
| | | editConfig: this.editCommonConfig, |
| | | queryInput: "", |
| | | select: "1", |
| | |
| | | tableList: {}, |
| | | search_map: {}, |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "name", min: 130 }, |
| | | { label: "供应商编号", prop: "number", min: 190 }, |
| | | { label: "供应商名称", prop: "name", min: 130, isCommonClick: true }, |
| | | { label: "供应商类型", prop: "supplierType", min: 130 }, |
| | | { label: "所属行业", prop: "industry", min: 130 }, |
| | | { label: "联系人", prop: "contact", min: 130 }, |
| | |
| | | { label: "状态", prop: "status_name", min: 130 }, |
| | | { label: "创建时间", prop: "member_name", min: 130 } |
| | | ], |
| | | showCol: ['供应商编号', '供应商名称', '供应商类型', '所属行业', '联系人', '联系电话','状态','创建时间'] |
| | | |
| | | showCol: ["供应商编号", "供应商名称", "供应商类型", "联系人", "联系电话", "状态"] |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableColumn:this.setColumnVisible(this.showCol), |
| | | tableColumn: this.setColumnVisible(this.showCol), |
| | | showcol: this.showCol, |
| | | allcol:[] |
| | | allcol: [] |
| | | } |
| | | 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++) { |
| | | const label = this.tableList.tableColumn[i].label |
| | |
| | | } |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val; |
| | | this.tableList.tableColumn = this.setColumnVisible(val); |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setColumnVisible(val) |
| | | }, |
| | | setColumnVisible(showCol){ |
| | | return this.tableColumn.map(ele=>{ |
| | | setColumnVisible(showCol) { |
| | | return this.tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn:showCol.includes(ele.label) |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | // 请求数据 |
| | | async getData(val, content) { |
| | | this.loading = true |
| | | |
| | | await getSupplierList({ |
| | | [val]: content, |
| | | page:1, |
| | | pageSize: 10 |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | if (res.data.data.list && res.data.data.list.length > 0) { |
| | | const list = res.data.data.list.map((item) => { |
| | | if (res.code == 200) { |
| | | if (res.data.list && res.data.list.length > 0) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | status_name: item.status === 0 ? "未启用" : "启用" |
| | | } |
| | | }) |
| | | // this.tableList.tableInfomation = list.slice(0, 5) || [] |
| | | this.tableList.tableInfomation = list |
| | | this.pagerOptions.totalCount = res.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 { |
| | |
| | | ref="tableSupplier" |
| | | :table-list="tableList" |
| | | @selCommonClick="selCommonClick" |
| | | @tableRowClick="tableRowClick" |
| | | @selTableCol="selTableCol" |
| | | @tableRowClick="tableRowClick" |
| | | :selectClassRow="selectRow" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="100"> |
| | |
| | | > |
| | | <template slot="leftButton"> |
| | | <div class="sub-title"><span class="sub-title-decorator"></span>可提供的产品</div> |
| | | <el-button type="primary" size="mini">创建采购单</el-button> |
| | | <el-button type="primary" size="mini" @click="creatPurchase">创建采购单</el-button> |
| | | </template> |
| | | <template slot="rightButton"> |
| | | <el-button type="primary" size="mini" @click="addNewProductClick">添加新产品</el-button> |
| | |
| | | <RaleteSupplierList v-if="raleteSupplierConfig.visible" :common-config="raleteSupplierConfig" /> |
| | | <!-- 添加新产品 --> |
| | | <AddNewProduct v-if="newProductConfig.visible" :add-common-config="newProductConfig" /> |
| | | <!-- 新建/编辑 --> |
| | | <AddPurchase v-if="editPurchaseConfig.visible" :edit-common-config="editPurchaseConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import RaleteSupplierList from "@/views/supplierManage/supplier/RaleteSupplierList" |
| | | import AddNewProduct from "@/views/supplierManage/supplier/AddNewProduct" |
| | | import { getProductList, deleteProduct } from "@/api/productManage/product" |
| | | import AddPurchase from "@/views/purchaseManage/purchase/components/AddPurchase" |
| | | |
| | | export default { |
| | | name: "SupplierManage", |
| | | props: {}, |
| | | components: { DetailSupplier, AddSupplier, RaleteSupplierList, AddNewProduct }, |
| | | components: { DetailSupplier, AddSupplier, RaleteSupplierList, AddNewProduct, AddPurchase }, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | data() { |
| | |
| | | { label: "采购价格", prop: "purchasePrice", min: 130 }, |
| | | { label: "供货时长(天)", prop: "deliveryTime", min: 130 }, |
| | | { label: "物流时长(天)", prop: "shippingDuration", min: 130 } |
| | | ] |
| | | ], |
| | | editPurchaseConfig: { |
| | | // 创建采购 |
| | | visible: false, |
| | | title: "创建", |
| | | infomation: { |
| | | supplierName: "" |
| | | } |
| | | }, |
| | | selectRow: {} |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | id: item.ID, |
| | | status_name: item.status === 0 ? "未启用" : "启用" |
| | | } |
| | | }) |
| | |
| | | this.pagerOptions.totalCount = res.data.total |
| | | if (list && list.length > 0) { |
| | | this.supplierId = this.tableList.tableInfomation[0].ID |
| | | this.selectRow = this.tableList.tableInfomation.length > 0 ? this.tableList.tableInfomation[0] : {} |
| | | } else { |
| | | this.supplierId = 0 |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.tableSupplier.$refs.table.setCurrentRow(this.tableList.tableInfomation[0]) |
| | | }) |
| | | // this.$nextTick(() => { |
| | | // this.$refs.tableSupplier.$refs.table.setCurrentRow(this.tableList.tableInfomation[0]) |
| | | // }) |
| | | |
| | | // 重新获取供应商列表后应该重置产品列表页码 |
| | | this.productPagerOptions.currPage = 1 |
| | |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.productPagerOptions.currPage = 1 |
| | | this.selectRow = row |
| | | this.supplierId = row.ID |
| | | this.getProductList() |
| | | }, |
| | |
| | | currentProductHandler(val) { |
| | | this.productPagerOptions.currPage = val |
| | | this.getProductList() |
| | | }, |
| | | // 创建采购单 |
| | | creatPurchase() { |
| | | this.editPurchaseConfig.visible = true |
| | | this.editPurchaseConfig.title = "创建" |
| | | this.editPurchaseConfig.infomation = { |
| | | supplierId: this.selectRow.ID, |
| | | supplierName: this.selectRow.name |
| | | } |
| | | } |
| | | } |
| | | } |