添加供应商接口联调、相关供应商页面修改、产品页面修改
| | |
| | | import axios from "axios" |
| | | |
| | | // 服务商列表 |
| | | export const getSupplierList = async (data) => { |
| | | return await axios.get(`/api/s/getSupplierList`, { |
| | | export function getSupplierList(data) { |
| | | return request({ |
| | | url: "/api/s/getSupplierList", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | // 用id查询服务商 |
| | | export const findSupplier = async (data) => { |
| | | return await axios.get(`/api/s/findSupplier`, { |
| | | export function findSupplier(data) { |
| | | return request({ |
| | | url: "/api/s/findSupplier", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | // 服务商类型列表 |
| | | export const getSupplierTypeList = async (data) => { |
| | | return await axios.get(`/api/st/getSupplierTypeList`, { |
| | | export function getSupplierTypeList(data) { |
| | | return request({ |
| | | url: "/api/st/getSupplierTypeList", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | // 预览合同 |
| | | export const previewContract = async (data) => { |
| | | return await axios.get(`/api/con/previewContract`, { |
| | | export function previewContract(data) { |
| | | return request({ |
| | | url: "/api/con/previewContract", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | | // 下载合同 |
| | | export const downloadContract = async (data) => { |
| | | return await axios.get(`/api/con/downloadContract`, { |
| | | export function downloadContract(data) { |
| | | return request({ |
| | | url: "/api/con/downloadContract", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | // 所属行业列表 |
| | | export const getIndustryList = async (data) => { |
| | | return await axios.get(`/api/i/getIndustryList`, { |
| | | export function getIndustryList(data) { |
| | | return request({ |
| | | url: "/api/i/getIndustryList", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | padding: 0; |
| | | } |
| | | } |
| | | .el-drawer__wrapper { |
| | | z-index: 9999 !important; |
| | | } |
| | |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | this.tableData = res.data.data.list |
| | | this.tableData = res.data.list |
| | | }) |
| | | }, |
| | | handleClose() { |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .detail-view { |
| | | z-index: 9999; |
| | | .header { |
| | | height: 56px; |
| | | display: flex; |
| | |
| | | <div class="product-manage"> |
| | | <div class="filter"> |
| | | <div class="filter-card"> |
| | | <!-- <SearchCommonView--> |
| | | <!-- ref="searchCommonView"--> |
| | | <!-- :search-options="searchOptions"--> |
| | | <!-- @searchClick="searchClick"--> |
| | | <!-- @resetClick="resetClick"--> |
| | | <!-- />--> |
| | | |
| | | <CommonSearch |
| | | :show-add="false" |
| | | :show-download="false" |
| | | :show-download="true" |
| | | :amount-view="false" |
| | | :show-action-btn="false" |
| | | :placeholder="'请输入产品名称/供应商'" |
| | | @searchClick="onFilterSearch" |
| | | /> |
| | | |
| | | <div class="add-view"> |
| | | <!-- <el-button type="primary" size="mini" @click="addBtnClick">新建</el-button>--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="body"> |
| | |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | <!-- 新建/编辑产品 --> |
| | | <AddProduct v-if="editConfig.visible" :add-common-config="editConfig" /> |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | searchText:'', |
| | | searchText: "", |
| | | tableList: {}, |
| | | searchOptions: [], |
| | | commonDetail: { |
| | |
| | | }, |
| | | tableColumn: [ |
| | | { label: "产品编码", prop: "number", min: 190, isCommonClick: true }, |
| | | { label: "产品名称", prop: "name", min: 130 ,default:true}, |
| | | { label: "产品名称", prop: "name", min: 130, default: true }, |
| | | { label: "供应商", prop: "supplierName", min: 130 }, |
| | | { label: "产品类别", prop: "productType", min: 130 }, |
| | | { label: "规格", prop: "specifications", min: 130 }, |
| | |
| | | { label: "最低库存", prop: "minimumStock", min: 80 }, |
| | | { label: "最高库存", prop: "maximumStock", min: 80 } |
| | | ], |
| | | showCol: ['产品编码', '产品名称', '供应商', '产品类别', '规格', '价格', '最低库存', '最高库存'] |
| | | showCol: ["产品编码", "产品名称", "供应商", "产品类别", "规格", "价格", "最低库存", "最高库存"] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | 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) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | selectIndex: true, |
| | | 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) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | |
| | | // this.getData(val.value, content) |
| | | // }, |
| | | |
| | | onFilterSearch(val){ |
| | | this.searchText = val ?? '' |
| | | onFilterSearch(val) { |
| | | this.searchText = val ?? "" |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .product-manage{ |
| | | .product-manage { |
| | | height: 100%; |
| | | overflow: hidden; |
| | | .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; |
| | | } |
| | | } |
| | | .body{ |
| | | .body { |
| | | box-sizing: border-box; |
| | | padding: 10px 20px; |
| | | border-radius: 12px; |
| | |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | this.supplierTypeOptions = res.data.data.list |
| | | this.supplierTypeOptions = res.data.list |
| | | }) |
| | | }, |
| | | // 所属行业 |
| | |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | this.industryOptions = res.data.data.list |
| | | this.industryOptions = res.data.list |
| | | }) |
| | | }, |
| | | handleClose() { |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | dialogWidth: "80%", |
| | | dialogWidth: "60%", |
| | | editConfig: this.commonConfig, |
| | | tableList: {}, |
| | | commonDetail: { |
| | | visible: false, |
| | | infomation: {} |
| | | } |
| | | }, |
| | | showCol: ["供应商编号", "供应商名称", "采购价格", "供货天数", "物流时长(天)"], |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "supplierNumber", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "supplierName", min: 130 }, |
| | | { label: "采购价格", prop: "purchasePrice", min: 130 }, |
| | | { label: "供货天数", prop: "deliveryTime", min: 130 }, |
| | | { label: "物流时长(天)", prop: "shippingDuration", min: 130 } |
| | | ] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getProductList() |
| | | }, |
| | | methods: { |
| | | setColumnVisible(showCol) { |
| | | return this.tableColumn.map((ele) => { |
| | | return { |
| | | ...ele, |
| | | isShowColumn: showCol.includes(ele.label) |
| | | } |
| | | }) |
| | | }, |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectIndex: true, |
| | | tableColumn: [ |
| | | { label: "供应商编号", prop: "supplierNumber", min: 190, isCommonClick: true }, |
| | | { label: "供应商名称", prop: "supplierName", min: 130 }, |
| | | { label: "采购价格", prop: "purchasePrice", min: 130 }, |
| | | { label: "供货天数", prop: "deliveryTime", min: 130 }, |
| | | { label: "物流时长(天)", prop: "shippingDuration", min: 130 } |
| | | ] |
| | | 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 getProductList(val, content) { |
| | |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.tableList.totalCount = res.data.data.total |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | }) |
| | | }, |
| | | handleClose() { |
| | |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res.data) |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.list.map((item) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | const list = res.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | status_name: item.status === 0 ? "未启用" : "启用" |
| | | } |
| | | }) |
| | | console.log(list) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | this.pagerOptions.totalCount = res.data.total |
| | | if (list && list.length > 0) { |
| | | this.supplierId = this.tableList.tableInfomation[0].ID |
| | | } else { |