From 7da8d51d212f96b2d419d4f22617827ea4df9e3d Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期六, 26 八月 2023 15:28:26 +0800 Subject: [PATCH] 服务商列表联调及无用api删除 --- src/views/supplierManage/supplier/index.vue | 132 +++++-- src/views/productManage/product/index.vue | 93 ++--- vue.config.js | 2 src/views/supplierManage/supplier/AddSupplier.vue | 200 +++++++---- src/views/other/commonDialog/SelectCommonDialog.vue | 203 ----------- src/views/productManage/product/AddProduct.vue | 49 +- src/api/supplierManage/supplier.js | 79 ++++ /dev/null | 34 -- src/common/untils/request.js | 3 src/views/supplierManage/supplier/AddNewProduct.vue | 34 +- src/api/common/other.js | 65 --- src/views/other/commonDialog/EditDropdownDialog.vue | 71 ++- src/api/productManage/product.js | 33 + 13 files changed, 444 insertions(+), 554 deletions(-) diff --git a/src/api/client/contacts.js b/src/api/client/contacts.js deleted file mode 100644 index 3c4932f..0000000 --- a/src/api/client/contacts.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鑱旂郴浜哄垪琛� -export function getContactList(data) { - return request({ - url: "/api/contact/list", - method: "post", - data - }) -} -// 娣诲姞鑱旂郴浜� -export function getAddContact(data) { - return request({ - url: "/api/contact/add", - method: "post", - data - }) -} -// 鍒犻櫎鑱旂郴浜� -export function getDeleteContact(data) { - return request({ - url: "/api/contact/delete", - method: "delete", - data - }) -} -// 鏇存柊鑱旂郴浜� -export function getUpdateContact(data) { - return request({ - url: "/api/contact/update", - method: "put", - data - }) -} diff --git a/src/api/client/followupRecords.js b/src/api/client/followupRecords.js deleted file mode 100644 index de9a91f..0000000 --- a/src/api/client/followupRecords.js +++ /dev/null @@ -1,42 +0,0 @@ -import request from "@/common/untils/request.js" - -// 璺熻繘璁板綍鍒楄〃 -export function getFollowRecordList(data) { - return request({ - url: "/api/followRecord/list", - method: "post", - data - }) -} -// 娣诲姞璺熻繘璁板綍 -export function getAddFollowRecord(data) { - return request({ - url: "/api/followRecord/add", - method: "post", - data - }) -} -// 鍒犻櫎璺熻繘璁板綍 -export function getDeleteFollowRecord(data) { - return request({ - url: "/api/followRecord/delete", - method: "delete", - data - }) -} -// 鏇存柊璺熻繘璁板綍 -export function getUpdateFollowRecord(data) { - return request({ - url: "/api/followRecord/update", - method: "put", - data - }) -} - -// 鑱旂郴鏂瑰紡鍒楄〃 -export function getContactInfoList() { - return request({ - url: "/api/contactInformation/list", - method: "get" - }) -} diff --git a/src/api/common/address.js b/src/api/common/address.js deleted file mode 100644 index 1a22d46..0000000 --- a/src/api/common/address.js +++ /dev/null @@ -1,9 +0,0 @@ -// import request from "@/common/untils/request.js" -import axios from "axios" - -// 鑾峰彇鍩庡競鍒楄〃 -export const getCityList = async (data) => { - return await axios.get(`/api/city/list`, { - params: data - }) -} diff --git a/src/api/common/other.js b/src/api/common/other.js index 9c1eda8..3e8d30a 100644 --- a/src/api/common/other.js +++ b/src/api/common/other.js @@ -1,63 +1,2 @@ -import request from "@/common/untils/request.js" -import axios from "axios" - -// 鑾峰彇鏁呴殰绫诲埆 -export function getFaultTypeList() { - return request({ - url: "/api/faultType/list", - method: "get" - }) -} - -// 鑾峰彇鏈嶅姟鏂瑰紡 -export function getServiceTypeList() { - return request({ - url: "/api/serviceType/list", - method: "get" - }) -} - -// 鑾峰彇涓ラ噸绋嬪害 -export function getSeverityList() { - return request({ - url: "/api/severity/list", - method: "get" - }) -} - -// 鑾峰彇浼樺厛绾у埆 -export function getPriorityLevelList() { - return request({ - url: "/api/priorityLevel/list", - method: "get" - }) -} - -// 鑺辫垂鏃堕棿鍒楄〃 -export function getTimeSpentList() { - return request({ - url: "/api/timeSpent/list", - method: "get" - }) -} - -// 鑾峰彇鏈嶅姟鍚堝悓绫诲瀷 -export function getServiceContractTypeList() { - return request({ - url: "/api/serviceContractType/list", - method: "get" - }) -} -// 鑾峰彇浜у搧鍒楄〃 -export const getProductList = async (data) => { - return await axios.get(`/api/product/list`, { - params: data - }) -} - -// 鑾峰彇甯歌闂鍒楄〃 -export const getFaqList = async (data) => { - return await axios.get(`/api/faq/list`, { - params: data - }) -} +// import request from "@/common/untils/request.js" +// import axios from "axios" diff --git a/src/api/common/payment.js b/src/api/common/payment.js deleted file mode 100644 index d0da76d..0000000 --- a/src/api/common/payment.js +++ /dev/null @@ -1,127 +0,0 @@ -import request from "@/common/untils/request.js" -import axios from "axios" - -// 鑾峰彇鏀舵璁″垝 -export const getCollectionPlanList = async (data) => { - return await axios.get(`/api/serviceCollectionPlan/list`, { - params: data - }) -} -// 娣诲姞鏀舵璁″垝 -export function addCollectionPlan(data) { - return request({ - url: "/api/serviceCollectionPlan/add", - method: "post", - data - }) -} -// 鏇存柊鏀舵璁″垝 -export function updateCollectionPlan(data) { - return request({ - url: "/api/serviceCollectionPlan/update", - method: "put", - data - }) -} -// 鍒犻櫎鏀舵璁″垝 -export function deleteCollectionPlan(data) { - return request({ - url: "/api/serviceCollectionPlan/delete/" + data.id, - method: "delete" - }) -} - -// 鑾峰彇鏀舵鍗� -export const getReceiptList = async (data) => { - return await axios.get(`/api/receipt/list`, { - params: data - }) -} -// 娣诲姞鏀舵鍗� -export function addReceipt(data) { - return request({ - url: "/api/receipt/add", - method: "post", - data - }) -} -// 鏇存柊鏀舵鍗� -export function updateReceipt(data) { - return request({ - url: "/api/receipt/update", - method: "put", - data - }) -} -// 鍒犻櫎鏀舵鍗� -export function deleteReceipt(data) { - return request({ - url: "/api/receipt/delete/" + data.id, - method: "delete" - }) -} - -// 鑾峰彇閿�鍞彂绁� -export const getInvoiceList = async (data) => { - return await axios.get(`/api/invoice/list`, { - params: data - }) -} -// 娣诲姞閿�鍞彂绁� -export function addInvoice(data) { - return request({ - url: "/api/invoice/add", - method: "post", - data - }) -} -// 鏇存柊閿�鍞彂绁� -export function updateInvoice(data) { - return request({ - url: "/api/invoice/update", - method: "put", - data - }) -} -// 鍒犻櫎閿�鍞彂绁� -export function deleteInvoice(data) { - return request({ - url: "/api/invoice/delete/" + data.id, - method: "delete" - }) -} - -// 鑾峰彇閾惰璐︽埛鍒楄〃 -export const getBankAccountList = async (data) => { - return await axios.get(`/api/bankAccount/list`, { - params: data - }) -} - -// 鑾峰彇鏀粯鏂瑰紡鍒楄〃 -export const getPaymentTypeList = async (data) => { - return await axios.get(`/api/paymentType/list`, { - params: data - }) -} - -// 鑾峰彇鍙戠エ绫诲埆鍒楄〃 -export const getInvoiceTypeList = async (data) => { - return await axios.get(`/api/invoiceType/list`, { - params: data - }) -} - -// 绁ㄦ嵁鐘舵�佸垪琛� -export const getInvoiceStatusList = async (data) => { - return await axios.get(`/api/invoiceStatus/list`, { - params: data - }) -} - -// 鐗╃悊鍏徃鍒楄〃 -export const getCourierCompanyList = async (data) => { - return await axios.get(`/api/courierCompany/list`, { - params: data - }) -} diff --git a/src/api/productManage/product.js b/src/api/productManage/product.js new file mode 100644 index 0000000..6a3f7af --- /dev/null +++ b/src/api/productManage/product.js @@ -0,0 +1,33 @@ +import request from "@/common/untils/request.js" +import axios from "axios" + +// 浜у搧鍒楄〃 +export const getProductList = async (data) => { + return await axios.get(`/api/p/getProductList`, { + params: data + }) +} +// 鍒涘缓浜у搧 +export function createProduct(data) { + return request({ + url: "/api/p/createProduct", + method: "post", + data + }) +} +// 鍒犻櫎浜у搧 +export function deleteProduct(data) { + return request({ + url: "/api/p/deleteProduct", + method: "delete", + data + }) +} +// 鏇存柊浜у搧 +export function updateProduct(data) { + return request({ + url: "/api/p/updateProduct", + method: "put", + data + }) +} diff --git a/src/api/sales/contractManage.js b/src/api/sales/contractManage.js deleted file mode 100644 index cc57f57..0000000 --- a/src/api/sales/contractManage.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鍚堝悓绠$悊鍒楄〃 -export function getContractList(data) { - return request({ - url: "/api/contract/list", - method: "post", - data - }) -} -// 娣诲姞鍚堝悓绠$悊 -export function getAddContract(data) { - return request({ - url: "/api/contract/add", - method: "post", - data - }) -} -// 鍒犻櫎鍚堝悓绠$悊 -export function getDelContract(data) { - return request({ - url: "/api/contract/delete", - method: "delete", - data - }) -} -// 鏇存柊鍚堝悓绠$悊 -export function getUpdateContract(data) { - return request({ - url: "/api/contract/update", - method: "put", - data - }) -} diff --git a/src/api/sales/generatePlan.js b/src/api/sales/generatePlan.js deleted file mode 100644 index 9a262da..0000000 --- a/src/api/sales/generatePlan.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鐢熸垚璁″垝鍒楄〃 -export function getPlanList(data) { - return request({ - url: "/api/plan/list", - method: "post", - data - }) -} -// 娣诲姞鐢熸垚璁″垝 -export function getAddPlan(data) { - return request({ - url: "/api/plan/add", - method: "post", - data - }) -} -// 鍒犻櫎鐢熸垚璁″垝 -export function getDelPlan(data) { - return request({ - url: "/api/plan/delete", - method: "delete", - data - }) -} -// 鏇存柊鐢熸垚璁″垝 -export function getUpdatePlan(data) { - return request({ - url: "/api/plan/update", - method: "put", - data - }) -} diff --git a/src/api/sales/masterOrder.js b/src/api/sales/masterOrder.js deleted file mode 100644 index 1e7622f..0000000 --- a/src/api/sales/masterOrder.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 涓昏鍗曞垪琛� -export function getMasterOrderList(data) { - return request({ - url: "/api/masterOrder/list", - method: "post", - data - }) -} -// 娣诲姞涓昏鍗� -export function getAddMasterOrder(data) { - return request({ - url: "/api/masterOrder/add", - method: "post", - data - }) -} -// 鍒犻櫎涓昏鍗� -export function getDelMasterOrder(data) { - return request({ - url: "/api/masterOrder/delete", - method: "delete", - data - }) -} -// 鏇存柊涓昏鍗� -export function getUpdateMasterOrder(data) { - return request({ - url: "/api/masterOrder/update", - method: "put", - data - }) -} diff --git a/src/api/sales/quotation.js b/src/api/sales/quotation.js deleted file mode 100644 index fac0256..0000000 --- a/src/api/sales/quotation.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鎶ヤ环鍗曞垪琛� -export function getQuotationList(data) { - return request({ - url: "/api/quotation/list", - method: "post", - data - }) -} -// 娣诲姞鎶ヤ环鍗� -export function getAddQuotation(data) { - return request({ - url: "/api/quotation/add", - method: "post", - data - }) -} -// 鍒犻櫎鎶ヤ环鍗� -export function getDelQuotation(data) { - return request({ - url: "/api/quotation/delete", - method: "delete", - data - }) -} -// 鏇存柊鎶ヤ环鍗� -export function getUpdateQuotation(data) { - return request({ - url: "/api/quotation/update", - method: "put", - data - }) -} diff --git a/src/api/sales/refundForm.js b/src/api/sales/refundForm.js deleted file mode 100644 index 8ecbdea..0000000 --- a/src/api/sales/refundForm.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 閿�鍞��娆惧崟鍒楄〃 -export function getSalesRefundList(data) { - return request({ - url: "/api/salesRefund/list", - method: "post", - data - }) -} -// 娣诲姞閿�鍞��娆惧崟 -export function getAddSalesRefund(data) { - return request({ - url: "/api/salesRefund/add", - method: "post", - data - }) -} -// 鍒犻櫎閿�鍞��娆惧崟 -export function getDelSalesRefund(data) { - return request({ - url: "/api/salesRefund/delete", - method: "delete", - data - }) -} -// 鏇存柊閿�鍞��娆惧崟 -export function getUpdateSalesRefund(data) { - return request({ - url: "/api/salesRefund/update", - method: "put", - data - }) -} diff --git a/src/api/sales/salesDetails.js b/src/api/sales/salesDetails.js deleted file mode 100644 index 642dc67..0000000 --- a/src/api/sales/salesDetails.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 閿�鍞槑缁嗗垪琛� -export function getSalesDetailsList(data) { - return request({ - url: "/api/salesDetails/list", - method: "post", - data - }) -} -// 娣诲姞閿�鍞槑缁� -export function getAddSalesDetails(data) { - return request({ - url: "/api/salesDetails/add", - method: "post", - data - }) -} -// 鍒犻櫎閿�鍞槑缁� -export function getDelSalesDetails(data) { - return request({ - url: "/api/salesDetails/delete", - method: "delete", - data - }) -} -// 鏇存柊閿�鍞槑缁� -export function getUpdateSalesDetails(data) { - return request({ - url: "/api/salesDetails/update", - method: "put", - data - }) -} diff --git a/src/api/sales/salesOpportunity.js b/src/api/sales/salesOpportunity.js deleted file mode 100644 index 9fd8d0a..0000000 --- a/src/api/sales/salesOpportunity.js +++ /dev/null @@ -1,51 +0,0 @@ -import request from "@/common/untils/request.js" - -// 閿�鍞満浼氬垪琛� -export function getSaleChanceList(data) { - return request({ - url: "/api/saleChance/list", - method: "post", - data - }) -} -// 娣诲姞閿�鍞満浼� -export function getAddSaleChance(data) { - return request({ - url: "/api/saleChance/add", - method: "post", - data - }) -} -// 鍒犻櫎閿�鍞満浼� -export function getDelSaleChance(data) { - return request({ - url: "/api/saleChance/delete", - method: "delete", - data - }) -} -// 鏇存柊閿�鍞満浼� -export function getUpdateSaleChance(data) { - return request({ - url: "/api/saleChance/update", - method: "put", - data - }) -} - -// 鑾峰彇閿�鍞樁娈� -export function getSaleStageList() { - return request({ - url: "/api/saleStage/list", - method: "get" - }) -} - -// 鎺ㄨ繘閿�鍞満浼� -export function pushSaleChance(data) { - return request({ - url: "/api/saleChance/push", - method: "put", - data - }) -} diff --git a/src/api/sales/salesReturn.js b/src/api/sales/salesReturn.js deleted file mode 100644 index 20a4910..0000000 --- a/src/api/sales/salesReturn.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 閿�鍞��璐у崟鍒楄〃 -export function getSalesReturnList(data) { - return request({ - url: "/api/salesReturn/list", - method: "post", - data - }) -} -// 娣诲姞閿�鍞��璐у崟 -export function getAddSalesReturn(data) { - return request({ - url: "/api/salesReturn/add", - method: "post", - data - }) -} -// 鍒犻櫎閿�鍞��璐у崟 -export function getDelSalesReturn(data) { - return request({ - url: "/api/salesReturn/delete", - method: "delete", - data - }) -} -// 鏇存柊閿�鍞��璐у崟 -export function getUpdateSalesReturn(data) { - return request({ - url: "/api/salesReturn/update", - method: "put", - data - }) -} diff --git a/src/api/sales/subOrder.js b/src/api/sales/subOrder.js deleted file mode 100644 index cdcc8c1..0000000 --- a/src/api/sales/subOrder.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 閿�鍞瓙鍗曞垪琛� -export function getSubOrderList(data) { - return request({ - url: "/api/subOrder/list", - method: "post", - data - }) -} -// 娣诲姞閿�鍞瓙鍗� -export function getAddSubOrder(data) { - return request({ - url: "/api/subOrder/add", - method: "post", - data - }) -} -// 鍒犻櫎閿�鍞瓙鍗� -export function getDelSubOrder(data) { - return request({ - url: "/api/subOrder/delete", - method: "delete", - data - }) -} -// 鏇存柊閿�鍞瓙鍗� -export function getUpdateSubOrder(data) { - return request({ - url: "/api/subOrder/update", - method: "put", - data - }) -} diff --git a/src/api/serviceManage/clientServiceOrder.js b/src/api/serviceManage/clientServiceOrder.js deleted file mode 100644 index 8ccdc04..0000000 --- a/src/api/serviceManage/clientServiceOrder.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鏈嶅姟鍗曞垪琛� -export function getServiceOrderList(data) { - return request({ - url: "/api/serviceOrder/list", - method: "post", - data - }) -} -// 娣诲姞鏈嶅姟鍗� -export function getAddServiceOrder(data) { - return request({ - url: "/api/serviceOrder/add", - method: "post", - data - }) -} -// 鍒犻櫎鏈嶅姟鍗� -export function getDelServiceOrder(data) { - return request({ - url: "/api/serviceOrder/delete", - method: "delete", - data - }) -} -// 鏇存柊鏈嶅姟鍗� -export function getUpdateServiceOrder(data) { - return request({ - url: "/api/serviceOrder/update", - method: "put", - data - }) -} diff --git a/src/api/serviceManage/serviceContract.js b/src/api/serviceManage/serviceContract.js deleted file mode 100644 index 49e079a..0000000 --- a/src/api/serviceManage/serviceContract.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鏈嶅姟鍚堝悓鍒楄〃 -export function getServiceContractList(data) { - return request({ - url: "/api/serviceContract/list", - method: "post", - data - }) -} -// 娣诲姞鏈嶅姟鍚堝悓 -export function getAddServiceContract(data) { - return request({ - url: "/api/serviceContract/add", - method: "post", - data - }) -} -// 鍒犻櫎鏈嶅姟鍚堝悓 -export function getDelServiceContract(data) { - return request({ - url: "/api/serviceContract/delete", - method: "delete", - data - }) -} -// 鏇存柊鏈嶅姟鍚堝悓 -export function getUpdateServiceContract(data) { - return request({ - url: "/api/serviceContract/update", - method: "put", - data - }) -} diff --git a/src/api/serviceManage/serviceFeeManage.js b/src/api/serviceManage/serviceFeeManage.js deleted file mode 100644 index 66ddc3d..0000000 --- a/src/api/serviceManage/serviceFeeManage.js +++ /dev/null @@ -1,33 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鏈嶅姟鏀惰垂绠$悊鍒楄〃 -export function getServiceFeeManageList(data) { - return request({ - url: "/api/serviceFeeManage/list", - method: "post", - data - }) -} -// 娣诲姞鏈嶅姟鏀惰垂绠$悊 -export function getAddServiceFeeManage(data) { - return request({ - url: "/api/serviceFeeManage/add", - method: "post", - data - }) -} -// 鍒犻櫎鏈嶅姟鏀惰垂绠$悊 -export function getDelServiceFeeManage(data) { - return request({ - url: "/api/serviceFeeManage/delete/" + data.id, - method: "delete" - }) -} -// 鏇存柊鏈嶅姟鏀惰垂绠$悊 -export function getUpdateServiceFeeManage(data) { - return request({ - url: "/api/serviceFeeManage/update", - method: "put", - data - }) -} diff --git a/src/api/serviceManage/serviceFollowup.js b/src/api/serviceManage/serviceFollowup.js deleted file mode 100644 index 3ca3f47..0000000 --- a/src/api/serviceManage/serviceFollowup.js +++ /dev/null @@ -1,34 +0,0 @@ -import request from "@/common/untils/request.js" - -// 鏈嶅姟鍥炶鍗曞垪琛� -export function getServiceFollowupList(data) { - return request({ - url: "/api/serviceFollowup/list", - method: "post", - data - }) -} -// 娣诲姞鏈嶅姟鍥炶鍗� -export function getAddServiceFollowup(data) { - return request({ - url: "/api/serviceFollowup/add", - method: "post", - data - }) -} -// 鍒犻櫎鏈嶅姟鍥炶鍗� -export function getDelServiceFollowup(data) { - return request({ - url: "/api/serviceFollowup/delete", - method: "delete", - data - }) -} -// 鏇存柊鏈嶅姟鍥炶鍗� -export function getUpdateServiceFollowup(data) { - return request({ - url: "/api/serviceFollowup/update", - method: "put", - data - }) -} diff --git a/src/api/supplierManage/supplier.js b/src/api/supplierManage/supplier.js new file mode 100644 index 0000000..0f556e1 --- /dev/null +++ b/src/api/supplierManage/supplier.js @@ -0,0 +1,79 @@ +import request from "@/common/untils/request.js" +import axios from "axios" + +// 鏈嶅姟鍟嗗垪琛� +export const getSupplierList = async (data) => { + return await axios.get(`/api/s/getSupplierList`, { + params: data + }) +} +// 鍒涘缓鏈嶅姟鍟� +export function createSupplier(data) { + return request({ + url: "/api/s/createSupplier", + method: "post", + data + }) +} +// 鍒犻櫎鏈嶅姟鍟� +export function deleteSupplier(data) { + return request({ + url: "/api/s/deleteSupplier", + method: "delete", + data + }) +} +// 鏇存柊鏈嶅姟鍟� +export function updateSupplier(data) { + return request({ + url: "/api/s/updateSupplier", + method: "put", + data + }) +} +// 淇敼鏈嶅姟鍟嗙姸鎬� +export function changeSupplierStatus(data) { + return request({ + url: "/api/s/changeSupplierStatus", + method: "post", + data + }) +} +// 鐢╥d鏌ヨ鏈嶅姟鍟� +export const findSupplier = async (data) => { + return await axios.get(`/api/s/findSupplier`, { + params: data + }) +} + +// 鏇存柊鏈嶅姟鍟嗙被鍨� +export function updateSupplierType(data) { + return request({ + url: "/api/st/updateSupplierType", + method: "put", + data + }) +} +// 鏈嶅姟鍟嗙被鍨嬪垪琛� +export const getSupplierTypeList = async (data) => { + return await axios.get(`/api/st/getSupplierTypeList`, { + params: data + }) +} + +// 涓婁紶鍚堝悓 +export const createContract = async (data) => { + return await axios.post(`/api/con/createContract`, data, { + headers: { "Content-Type": "application/x-www-form-urlencoded;charset=utf-8" } + }) +} +// 鍒犻櫎鍚堝悓 +export function deleteContract(data) { + return request({ + url: "/api/con/deleteContract", + method: "delete", + data + }) +} + +// diff --git a/src/common/untils/request.js b/src/common/untils/request.js index 866adce..9270bbc 100644 --- a/src/common/untils/request.js +++ b/src/common/untils/request.js @@ -30,9 +30,6 @@ /* //瀵瑰搷搴旀暟鎹仛浜涗簨 */ if (res.data.code === 200) { return res.data ? res.data : {} - } else if (res.data.code === 700001 || res.data.code === 700005) { - console.log("瀹㈡埛鍚嶇О閲嶅") - return res } else { Message({ message: res.data.msg, diff --git a/src/views/other/commonDialog/EditDropdownDialog.vue b/src/views/other/commonDialog/EditDropdownDialog.vue index 142bf25..4691fa8 100644 --- a/src/views/other/commonDialog/EditDropdownDialog.vue +++ b/src/views/other/commonDialog/EditDropdownDialog.vue @@ -13,7 +13,7 @@ <el-input v-model="scope.row.name" size="mini"></el-input> </template> </el-table-column> - <el-table-column label="璁句负榛樿" prop="setDefault"> + <!-- <el-table-column label="璁句负榛樿" prop="setDefault"> <template slot-scope="scope"> <el-switch v-model="scope.row.setDefault" @@ -24,7 +24,7 @@ > </el-switch> </template> - </el-table-column> + </el-table-column> --> <el-table-column label="鎿嶄綔" width="110px"> <template slot-scope="scope"> <i @@ -47,7 +47,7 @@ <el-button type="text" size="mini" @click="addDropdown">鏂板涓嬫媺妗�</el-button> </div> <div slot="footer"> - <el-button type="primary" size="small" @click="editConfig.editVisible = false">淇濆瓨</el-button> + <el-button type="primary" size="small" @click="saveClick">淇濆瓨</el-button> <el-button size="small" @click="editConfig.editVisible = false">鍙栨秷</el-button> </div> </el-dialog> @@ -55,6 +55,7 @@ </template> <script> +import { getSupplierTypeList, updateSupplierType } from "@/api/supplierManage/supplier" export default { name: "EditDropdownDialog", props: { @@ -79,32 +80,31 @@ return { dialogWidth: "20%", editConfig: this.editDropdownConfig, - tableData: [ - { - name: "1", - color: "red", - setDefault: true - }, - { - name: "2", - color: "blue", - setDefault: false - }, - { - name: "3", - color: null, - setDefault: false - }, - { - name: "4", - color: null, - setDefault: false - } - ] + tableData: [] } }, - created() {}, + created() { + this.setList() + }, methods: { + setList() { + if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") { + this.getSupplierTypeList() + } + }, + // 渚涘簲鍟嗙被鍨� + async getSupplierTypeList() { + await getSupplierTypeList({ + page: 1, + pageSize: 100 + }).then((res) => { + console.log("dsss") + console.log(res.data) + this.tableData = res.data.data.list + }) + }, + // 鎵�灞炶涓� + async getIndustryList() {}, handleClose() { this.editConfig.editVisible = false }, @@ -151,10 +151,23 @@ // 鏂板涓嬫媺妗� addDropdown() { this.tableData.push({ - name: "5", - color: null, - setDefault: false + name: "", + id: 0 }) + }, + async saveClick() { + console.log(this.tableData) + if (this.editConfig.title === "渚涘簲鍟嗙被鍨�") { + updateSupplierType({ + supplierTypes: this.tableData + }).then((res) => { + console.log(res) + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getData() + } + }) + } } } } diff --git a/src/views/other/commonDialog/SelectCommonDialog.vue b/src/views/other/commonDialog/SelectCommonDialog.vue index afab011..34cde2a 100644 --- a/src/views/other/commonDialog/SelectCommonDialog.vue +++ b/src/views/other/commonDialog/SelectCommonDialog.vue @@ -39,11 +39,6 @@ </template> <script> -import { getMasterOrderList } from "@/api/sales/masterOrder" -import { getQuotationList } from "@/api/sales/quotation" -import { getSalesDetailsList } from "@/api/sales/salesDetails" -import { getServiceContractList } from "@/api/serviceManage/serviceContract" -import { getServiceOrderList } from "@/api/serviceManage/clientServiceOrder" import { getProductList } from "@/api/common/other" export default { name: "EditSelCommonDialog", @@ -84,64 +79,7 @@ }, methods: { setTable() { - if (this.editConfig.title === "閿�鍞�诲崟") { - this.tableList = { - tableInfomation: [], - tableColumn: [ - { label: "鍗曟嵁缂栧彿", prop: "number", isClick: true }, // 鍗曟嵁缂栧彿 - { label: "璐熻矗浜�", prop: "member_name" } // 璐熻矗浜� - ] - } - this.searchSel = { value: "number", label: "鍗曟嵁缂栧彿" } - } else if (this.editConfig.title === "鏈嶅姟鍚堝悓") { - this.tableList = { - tableInfomation: [], - tableColumn: [ - { label: "瀹㈡埛鍚嶇О", prop: "client_name" }, // 瀹㈡埛鍚嶇О - { label: "鏈嶅姟鍚堝悓缂栧彿", prop: "number", isClick: true }, // 鏈嶅姟鍚堝悓缂栧彿 - { label: "璐熻矗浜�", prop: "member_name" }, // 璐熻矗浜� - { label: "鍚堣", prop: "total" }, // 鍚堣 - { label: "绛剧害鏃ユ湡", prop: "signTime", isTime: true }, // 绛剧害鏃ユ湡 - { label: "鍚堝悓鐘舵��", prop: "serviceContractStatus" } // 鍚堝悓鐘舵�� - ] - } - this.searchSel = { value: "number", label: "鏈嶅姟鍚堝悓缂栧彿" } - } else if (this.editConfig.title === "閿�鍞槑缁嗗崟") { - this.tableList = { - tableInfomation: [], - tableColumn: [ - { label: "瀹㈡埛鍚嶇О", prop: "client_name" }, // 瀹㈡埛鍚嶇О - { label: "璁㈠崟缂栧彿", prop: "number", isClick: true }, // 璁㈠崟缂栧彿 - { label: "绛剧害鏃ユ湡", prop: "signTime" }, // 绛剧害鏃ユ湡 - { label: "閿�鍞礋璐d汉", prop: "member_name" }, // 閿�鍞礋璐d汉 - { label: "鍚堣", prop: "tptal" } // 鍚堣 - ] - } - this.searchSel = { value: "number", label: "璁㈠崟缂栧彿" } - } else if (this.editConfig.title === "鎶ヤ环鍗�") { - this.tableList = { - tableInfomation: [], - tableColumn: [ - { label: "鎶ヤ环鍗曞彿", prop: "number", isClick: true }, // 鎶ヤ环鍗曞彿 - { label: "閿�鍞礋璐d汉", prop: "member_name" } // 閿�鍞礋璐d汉 - ] - } - this.searchSel = { value: "number", label: "鎶ヤ环鍗曞彿" } - } else if (this.editConfig.title === "瀹㈡埛鏈嶅姟鍗�") { - this.tableList = { - tableInfomation: [], - tableColumn: [ - { label: "鏈嶅姟鍗曠紪鍙�", prop: "serviceNumber", isClick: true }, // 鏈嶅姟鍗曠紪鍙� - { label: "涓婚", prop: "subject" }, // 涓婚 - { label: "鏈嶅姟鏂瑰紡", prop: "serviceType_name" }, // 鏈嶅姟鏂瑰紡 - { label: "鏈嶅姟浜哄憳", prop: "serviceMan_name" }, // 鏈嶅姟浜哄憳 - { label: "浼樺厛绾у埆", prop: "priorityLevel_name" }, // 浼樺厛绾у埆 - { label: "澶勭悊鐘舵��", prop: "serviceOrderStatus_name" }, // 澶勭悊鐘舵�� - { label: "瀹㈡埛绛惧悕", prop: "qianming" } // 瀹㈡埛绛惧悕 - ] - } - this.searchSel = { value: "serviceNumber", label: "鏈嶅姟鍗曠紪鍙�" } - } else if (this.editConfig.title === "浜у搧鍚嶇О") { + if (this.editConfig.title === "浜у搧鍚嶇О") { this.tableList = { tableInfomation: [], tableColumn: [ @@ -161,146 +99,9 @@ // 璇锋眰鏁版嵁 async getData() { this.loading = true - if (this.editConfig.title === "閿�鍞�诲崟") { - this.getMasterOrderList() - } else if (this.editConfig.title === "鏈嶅姟鍚堝悓") { - this.getServiceContractList() - } else if (this.editConfig.title === "閿�鍞槑缁嗗崟") { - this.getSalesDetailsList() - } else if (this.editConfig.title === "鎶ヤ环鍗�") { - this.getQuotationList() - } else if (this.editConfig.title === "瀹㈡埛鏈嶅姟鍗�") { - this.getServiceOrderList() - } else if (this.editConfig.title === "浜у搧鍚嶇О") { + if (this.editConfig.title === "浜у搧鍚嶇О") { this.getProductList() } - }, - // 閿�鍞�诲崟 - async getMasterOrderList() { - await getMasterOrderList({ - search_map: this.search_map, - page: 0, - pageSize: 0 - }).then((res) => { - if (res.code === 200) { - if (res.data.list && res.data.list.length > 0) { - const list = res.data.list.map((item) => { - return { - ...item, - member_name: item.member.username - } - }) - this.tableList.tableInfomation = list.slice(0, 5) || [] - } else { - this.tableList.tableInfomation = [] - } - } - this.loading = false - }) - }, - // 鏈嶅姟鍚堝悓 - async getServiceContractList() { - await getServiceContractList({ - keyword: this.keyword, - keywordType: this.keywordType, - page: 0, - pageSize: 0 - }).then((res) => { - if (res.code === 200) { - if (res.data.list && res.data.list.length > 0) { - const list = res.data.list.map((item) => { - return { - ...item, - client_name: item.client.name, - member_name: item.member.username, - serviceContractStatus: item.serviceContractStatus.name - } - }) - this.tableList.tableInfomation = list.slice(0, 5) || [] - } else { - this.tableList.tableInfomation = [] - } - } - this.loading = false - }) - }, - // 鎶ヤ环鍗� - async getQuotationList() { - await getQuotationList({ - search_map: this.search_map, - page: 0, - pageSize: 0 - }).then((res) => { - if (res.code === 200) { - if (res.data.list && res.data.list.length > 0) { - const list = res.data.list.map((item) => { - return { - ...item, - member_name: item.member.username - } - }) - this.tableList.tableInfomation = list.slice(0, 5) || [] - } else { - this.tableList.tableInfomation = [] - } - } - this.loading = false - }) - }, - // 閿�鍞槑缁嗗崟 - async getSalesDetailsList() { - await getSalesDetailsList({ - keyword: this.keyword, - keywordType: this.keywordType, - page: 0, - pageSize: 0 - }).then((res) => { - if (res.code === 200) { - if (res.data.list && res.data.list.length > 0) { - const list = res.data.list.map((item) => { - return { - ...item, - client_name: item.client.name, - member_name: item.Member.username - } - }) - this.tableList.tableInfomation = list.slice(0, 5) || [] - } else { - this.tableList.tableInfomation = [] - } - } - this.loading = false - }) - }, - // 瀹㈡埛鏈嶅姟鍗� - async getServiceOrderList() { - await getServiceOrderList({ - keyword: this.keyword, - keywordType: this.keywordType, - page: 0, - pageSize: 0 - }).then((res) => { - if (res.code === 200) { - if (res.data.data && res.data.data.length > 0) { - const list = res.data.data.map((item) => { - return { - ...item, - client_name: item.Client.name, - serviceType_name: item.ServiceType.name, - faultType_name: item.FaultType.name, - serviceContract_Number: item.ServiceContract.number, - serviceMan_name: item.serviceMan.username, - priorityLevel_name: item.PriorityLevel.name, - serviceOrderStatus_name: item.ServiceOrderStatus_name - } - }) - this.tableList.tableInfomation = list.slice(0, 5) || [] - } else { - this.tableList.tableInfomation = [] - } - } - this.loading = false - }) }, // 浜у搧鍚嶇О async getProductList() { diff --git a/src/views/productManage/product/AddProduct.vue b/src/views/productManage/product/AddProduct.vue index a1bd60e..653b479 100644 --- a/src/views/productManage/product/AddProduct.vue +++ b/src/views/productManage/product/AddProduct.vue @@ -161,7 +161,6 @@ <script> let inputElement = null -import { getAddContact, getUpdateContact } from "@/api/client/contacts" import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" export default { name: "AddProductDialog", @@ -216,37 +215,25 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddContact(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + // getAddContact(params) + // .then((res) => { + // console.log(res) + // this.editConfig.visible = false + // if (res.code === 200) { + // this.$message.success("娣诲姞鎴愬姛") + // this.$parent.getData() + // } + // }) } else { - getUpdateContact(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + // getUpdateContact(params) + // .then((res) => { + // console.log(res) + // this.editConfig.visible = false + // if (res.code === 200) { + // this.$message.success("缂栬緫鎴愬姛") + // this.$parent.getData() + // } + // }) } } else { console.log("error submit") diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue index 6485e3e..d797006 100644 --- a/src/views/productManage/product/index.vue +++ b/src/views/productManage/product/index.vue @@ -13,12 +13,7 @@ </div> </div> <template> - <TableCommonView - ref="tableListRef" - :table-list="tableList" - @selCommonClick="selCommonClick" - @getSelectArray="getSelectArray" - > + <TableCommonView ref="tableListRef" :table-list="tableList" @selCommonClick="selCommonClick"> <template slot="tableButton"> <el-table-column label="鎿嶄綔" width="120"> <template slot-scope="scope"> @@ -42,7 +37,7 @@ <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" +import { getProductList, deleteProduct } from "@/api/productManage/product" import DetailProduct from "@/views/productManage/product/DetailProduct" import AddProduct from "@/views/productManage/product/AddProduct" @@ -55,7 +50,6 @@ data() { return { tableList: {}, - selValueList: [], searchOptions: [], commonDetail: { visible: false, @@ -66,8 +60,7 @@ visible: false, title: "鏂板缓", infomation: {} - }, - search_map: {} + } } }, created() { @@ -83,10 +76,10 @@ { label: "浜у搧缂栫爜", prop: "number", min: 190, isCommonClick: true }, { label: "浜у搧鍚嶇О", prop: "name", min: 130 }, { label: "渚涘簲鍟�", prop: "id", min: 130 }, - { label: "浜у搧绫诲埆", prop: "contact_phone", min: 130 }, + { label: "浜у搧绫诲埆", prop: "productType", min: 130 }, { label: "瑙勬牸", prop: "sales_resources", min: 130 }, { label: "鍨嬪彿", prop: "province", min: 130 }, - { label: "鍗曚綅", prop: "sales_sources_id", min: 60 }, + { label: "鍗曚綅", prop: "unit", min: 60 }, { label: "浠锋牸", prop: "contact_phone1", min: 130 }, { label: "鏈�浣庡簱瀛�", prop: "desc", min: 80 }, { label: "鏈�楂樺簱瀛�", prop: "member_name", min: 80 } @@ -100,37 +93,30 @@ } }, // 璇锋眰鏁版嵁 - async getData() { - await getSalesLeadsList({ - search_map: this.search_map, + async getData(val, content) { + await getProductList({ + val, + content, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize - }) - .then((res) => { - const list = res.data.list.map((item) => { + }).then((res) => { + if (res.data.code === 200) { + const list = res.data.data.list.map((item) => { return { - ...item, - sales_resources: item.sales_sources.name, - member_name: item.member.username + ...item } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.count - }) - .catch((err) => { - console.log(err) - }) + this.pagerOptions.totalCount = res.data.data.total + } + }) }, // 鎼滅储 searchClick(val, content) { console.log(val, content) - this.search_map = { - [val.value]: content - } - this.getData() + this.getData(val, content) }, resetClick() { - this.search_map = {} this.getData() }, // 鏂板缓 @@ -143,37 +129,26 @@ console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" + this.editConfig.infomation = { ...row } }, // 鍒犻櫎 - delClick() { - if (this.selValueList && this.selValueList.length > 0) { - this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning" - }) - .then(() => { - console.log("dddd") - getDeleteSalesLeads({ ids: this.selValueList }).then((response) => { - if (response.code === 200) { - this.$message.success("鍒犻櫎鎴愬姛") - this.getData() - } else { - this.$message.warning("鍒犻櫎澶辫触") - } - }) - }) - .catch(() => {}) - } else { - this.$message.warning("璇疯嚦灏戦�夋嫨涓�鏉¤褰�") - } - }, - getSelectArray(val) { - this.selValueList = [] - const list = val.map((item) => { - return item.id + delClick(val) { + this.$confirm("鏄惁纭鍒犻櫎?", "璀﹀憡", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning" }) - this.selValueList = list + .then(() => { + deleteProduct({ id: val }).then((response) => { + if (response.code === 200) { + this.$message.success("鍒犻櫎鎴愬姛") + this.getData() + } else { + this.$message.warning("鍒犻櫎澶辫触") + } + }) + }) + .catch(() => {}) }, // 璇︽儏 selCommonClick(row) { diff --git a/src/views/supplierManage/supplier/AddNewProduct.vue b/src/views/supplierManage/supplier/AddNewProduct.vue index 106c93d..f1d305e 100644 --- a/src/views/supplierManage/supplier/AddNewProduct.vue +++ b/src/views/supplierManage/supplier/AddNewProduct.vue @@ -31,7 +31,7 @@ </template> <script> -import { getAddContact, getUpdateContact } from "@/api/client/contacts" +// import { getAddContact, getUpdateContact } from "@/api/client/contacts" import CommonFormTableView from "@/components/makepager/CommonFormTableView" export default { name: "AddNewProduct", @@ -75,23 +75,23 @@ const params = this.saveParams() console.log(params) if (this.editConfig.title === "娣诲姞") { - getAddContact(params).then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message.success("娣诲姞鎴愬姛") - this.$parent.getData() - } - }) + // getAddContact(params).then((res) => { + // console.log(res) + // this.editConfig.visible = false + // if (res.code === 200) { + // this.$message.success("娣诲姞鎴愬姛") + // this.$parent.getData() + // } + // }) } else { - getUpdateContact(params).then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message.success("缂栬緫鎴愬姛") - this.$parent.getData() - } - }) + // getUpdateContact(params).then((res) => { + // console.log(res) + // this.editConfig.visible = false + // if (res.code === 200) { + // this.$message.success("缂栬緫鎴愬姛") + // this.$parent.getData() + // } + // }) } }, saveParams() { diff --git a/src/views/supplierManage/supplier/AddSupplier.vue b/src/views/supplierManage/supplier/AddSupplier.vue index 42d0ac3..c313db1 100644 --- a/src/views/supplierManage/supplier/AddSupplier.vue +++ b/src/views/supplierManage/supplier/AddSupplier.vue @@ -29,20 +29,25 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="渚涘簲鍟嗗悕绉�" prop="supplier_name"> + <el-form-item label="渚涘簲鍟嗗悕绉�" prop="name"> <el-input v-model="editConfig.infomation.name"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="渚涘簲鍟嗙被鍨�" prop="supplierType_id"> + <el-form-item label="渚涘簲鍟嗙被鍨�" prop="supplierType"> <div class="custom-name"> <el-select - v-model="editConfig.infomation.supplierType_id" + v-model="editConfig.infomation.supplierType" placeholder="璇烽�夋嫨渚涘簲鍟嗙被鍨�" class="common-select-sel" size="mini" > - <el-option v-for="item in supplierTypeOptions" :key="item.id" :label="item.name" :value="item.id"> + <el-option + v-for="item in supplierTypeOptions" + :key="item.id" + :label="item.name" + :value="item.name" + > </el-option> </el-select> <div class="common-select-btn" @click="setSupplierType"><i class="el-icon-setting"></i></div> @@ -50,15 +55,15 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鎵�灞炶涓�" prop="industry_id"> + <el-form-item label="鎵�灞炶涓�" prop="industry"> <div class="custom-name"> <el-select - v-model="editConfig.infomation.industry_id" + v-model="editConfig.infomation.industry" placeholder="璇烽�夋嫨渚涘簲鍟嗚涓�" class="common-select-sel" size="mini" > - <el-option v-for="item in industryOptions" :key="item.id" :label="item.name" :value="item.id"> + <el-option v-for="item in industryOptions" :key="item.id" :label="item.name" :value="item.name"> </el-option> </el-select> <div class="common-select-btn" @click="setIndustry"><i class="el-icon-setting"></i></div> @@ -66,8 +71,8 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鑱旂郴浜�" prop="contact_name"> - <el-input v-model="editConfig.infomation.contact_name"></el-input> + <el-form-item label="鑱旂郴浜�" prop="contact"> + <el-input v-model="editConfig.infomation.contact"></el-input> </el-form-item> </el-col> <el-col :span="12"> @@ -81,8 +86,17 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="閿�鍞礋璐d汉" prop="sale_member"> - <el-input v-model="editConfig.infomation.sale_member" disabled></el-input> + <el-form-item label="閿�鍞礋璐d汉" prop="responsiblePersonId"> + <!-- <el-input v-model="editConfig.infomation.responsiblePersonId"></el-input> --> + <el-select + v-model="editConfig.infomation.responsiblePersonId" + placeholder="璇烽�夋嫨" + size="mini" + style="width: 63%" + > + <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> + </el-option> + </el-select> </el-form-item> </el-col> <el-col :span="12"> @@ -91,19 +105,18 @@ </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="璇︾粏鍦板潃" prop="address_detail"> + <el-form-item label="璇︾粏鍦板潃" prop="detailAddress"> <el-input type="textarea" :autosize="{ minRows: 2 }" placeholder="璇疯緭鍏ュ唴瀹�" - v-model="editConfig.infomation.address_detail" - disabled + v-model="editConfig.infomation.detailAddress" ></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="缃戝潃" prop="webUrl"> - <el-input v-model="editConfig.infomation.webUrl" disabled></el-input> + <el-form-item label="缃戝潃" prop="url"> + <el-input v-model="editConfig.infomation.url"></el-input> </el-form-item> </el-col> </el-row> @@ -113,18 +126,18 @@ <div class="basic-info-view"> <el-row> <el-col :span="12"> - <el-form-item label="鎴峰悕" prop="account_name"> - <el-input v-model="editConfig.infomation.account_name" disabled></el-input> + <el-form-item label="鎴峰悕" prop="accountName"> + <el-input v-model="editConfig.infomation.accountName"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="寮�鎴疯" prop="account_name"> - <el-input v-model="editConfig.infomation.account_name" disabled></el-input> + <el-form-item label="寮�鎴疯" prop="bank"> + <el-input v-model="editConfig.infomation.bank"></el-input> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="璐﹀彿" prop="account_name"> - <el-input v-model="editConfig.infomation.account_name" disabled></el-input> + <el-form-item label="璐﹀彿" prop="account"> + <el-input v-model="editConfig.infomation.account"></el-input> </el-form-item> </el-col> <el-col :span="24"> @@ -139,14 +152,24 @@ </template> <div class="annex-view"> <div @click="addAnnexClick"> - <div style="display: flex; float: right"> - <div style="font-size: 16px"><i class="el-icon-paperclip"></i></div> - <span>娣诲姞闄勪欢</span> - </div> + <el-upload + class="upload-demo" + action="https://jsonplaceholder.typicode.com/posts/" + :limit="1" + :before-upload="beforeAvatarUpload" + :on-exceed="handleExceed" + :file-list="fileList" + :show-file-list="false" + > + <div style="display: flex; float: right"> + <div style="font-size: 16px"><i class="el-icon-paperclip"></i></div> + <span>娣诲姞闄勪欢</span> + </div> + </el-upload> </div> </div> - <div class="file-content"> - <div>鏂囦欢鍚嶇О</div> + <div v-if="file_name && file_name.length > 0" class="file-content"> + <div>{{ file_name }}</div> <div> <el-button type="text">棰勮</el-button> <el-button type="text">涓嬭浇</el-button> @@ -170,8 +193,9 @@ </template> <script> -import { getAddContact, getUpdateContact } from "@/api/client/contacts" +import { createSupplier, createContract, updateSupplier } from "@/api/supplierManage/supplier" import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" +import { getSupplierTypeList } from "@/api/supplierManage/supplier" export default { name: "AddSupplierDialog", props: { @@ -193,8 +217,8 @@ dialogWidth: "80%", editConfig: this.addCommonConfig, rules: { - supplier_name: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }], - member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], + name: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }], + responsiblePersonId: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }], phone: [ { required: false, message: "", trigger: "blur" }, { len: 11, message: "闀垮害鍦�11涓瓧绗�", trigger: "blur" }, @@ -213,22 +237,34 @@ } ] }, - supplierTypeOptions: [], // 渚涘簲鍟嗙被鍨� - industryOptions: [], // 鎵�灞炶涓� - memberOptions: [], + supplierTypeOptions: [{ id: 1, name: "渚涘簲鍟嗙被鍨�1" }], // 渚涘簲鍟嗙被鍨� + industryOptions: [{ id: 1, name: "鎵�灞炶涓�1" }], // 鎵�灞炶涓� + memberOptions: [{ id: 1, username: "admin" }], editDropdownConfig: { editVisible: false, title: "", infomation: {} - } + }, + fileList: [], + file_name: "", + file_id: this.addCommonConfig.infomation.fileId } }, created() { - if (this.editConfig.title !== "鏂板缓" && this.editConfig.infomation.province_id !== 0) { - this.getCityList(this.editConfig.infomation.province_id, "edit") - } + this.getSupplierTypeList() }, methods: { + // 渚涘簲鍟嗙被鍨� + async getSupplierTypeList() { + await getSupplierTypeList({ + page: 1, + pageSize: 100 + }).then((res) => { + console.log("dsss") + console.log(res.data) + this.supplierTypeOptions = res.data.data.list + }) + }, handleClose() { this.editConfig.visible = false }, @@ -238,17 +274,13 @@ if (valid) { console.log(this.editConfig.infomation) const params = this.saveParams() - console.log(params) if (this.editConfig.title === "鏂板缓") { - getAddContact(params) + createSupplier(params) .then((res) => { console.log(res) this.editConfig.visible = false if (res.code === 200) { - this.$message({ - message: "娣诲姞鎴愬姛", - type: "success" - }) + this.$message.success("娣诲姞鎴愬姛") this.$parent.getData() } }) @@ -256,21 +288,13 @@ console.log(err) }) } else { - getUpdateContact(params) - .then((res) => { - console.log(res) - this.editConfig.visible = false - if (res.code === 200) { - this.$message({ - message: "缂栬緫鎴愬姛", - type: "success" - }) - this.$parent.getData() - } - }) - .catch((err) => { - console.log(err) - }) + updateSupplier(params).then((res) => { + this.editConfig.visible = false + if (res.code === 200) { + this.$message.success("缂栬緫鎴愬姛") + this.$parent.getData() + } + }) } } else { console.log("error submit") @@ -281,22 +305,22 @@ saveParams() { let data = this.editConfig.infomation let params = { - id: this.editConfig.title === "鏂板缓" ? 0 : data.id, - birthday: data.birthday || "", - city_id: data.city_id || 0, - client_id: this.clientId || 0, - country_id: data.country_id || 0, - desc: data.desc || "", + account: data.account || "", + accountName: data.accountName || "", + bank: data.bank || "", + contact: data.contact || "", + detailAddress: data.detailAddress || "", email: data.email || "", - is_first: data.is_first || false, - member_id: data.member_id || 0, + fileId: this.file_id || 0, + id: data.ID || 0, + industry: data.industry || "", name: data.name || "", number: data.number || "", phone: data.phone || "", - position: data.position || "", - province_id: data.province_id || 0, - region_id: data.region_id || 0, - wechat: data.wechat || "" + responsiblePersonId: data.responsiblePersonId || 0, + status: data.status || 0, + supplierType: data.supplierType || "", + url: data.url || "" } return params }, @@ -311,6 +335,40 @@ setIndustry() { this.editDropdownConfig.editVisible = true this.editDropdownConfig.title = "鎵�灞炶涓�" + }, + // 鏂囦欢涓婁紶--start + beforeAvatarUpload(file) { + // 鏂囦欢绫诲瀷鍒ゆ柇 + var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1) + const extension = testmsg === "doc" + const extension2 = testmsg === "pdf" + const extension3 = testmsg === "docx" + if (!extension && !extension2 && !extension3) { + this.$message({ + message: "涓婁紶鏂囦欢鍙兘鏄� word銆乸df鏍煎紡!", + type: "warning" + }) + this.fileList = [] + } else { + // 鍙傛暟鎷兼帴 + console.log(file) + let fd = new FormData() + fd.append("file", file) + fd.append("name", file.name) + // 璋冪敤鎺ュ彛 + createContract(fd).then((res) => { + if (res.status == 200) { + console.log(res.data.data) + this.file_name = file.name + this.file_id = res.data.data.id + } + }) + } + }, + // 鏂囦欢瓒呭嚭涓暟闄愬埗鏃剁殑閽╁瓙 + handleExceed(files, fileList) { + console.log(fileList) + this.$message.warning(`褰撳墠闄愬埗閫夋嫨 1 涓枃浠讹紝鏈閫夋嫨浜� ${files.length} 涓枃浠禶) } } } diff --git a/src/views/supplierManage/supplier/index.vue b/src/views/supplierManage/supplier/index.vue index 354b34f..00e1117 100644 --- a/src/views/supplierManage/supplier/index.vue +++ b/src/views/supplierManage/supplier/index.vue @@ -22,8 +22,14 @@ <template slot="tableButton"> <el-table-column label="鎿嶄綔" width="120"> <template slot-scope="scope"> - <el-button @click="handleClick(scope.row)" type="text" size="small">鍚敤</el-button> - <el-button @click="editClick(scope.row)" type="text" size="small">鍋滅敤</el-button> + <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> <!-- <el-button @click="delClick(scope.row.id)" type="text" size="small">鍒犻櫎</el-button> --> </template> @@ -45,8 +51,8 @@ class="search" ref="searchCommonView" :search-options="searchProductOptions" - @searchClick="searchClick" - @resetClick="resetClick" + @searchClick="searchProductClick" + @resetClick="resetProductClick" /> <div class="add-view"> <el-button type="primary" size="mini" @click="addNewProductClick">娣诲姞鏂颁骇鍝�</el-button> @@ -71,7 +77,7 @@ </template> </TableCommonView> <div class="btn-pager"> - <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> + <PagerView class="page" :pager-options="productPagerOptions" v-on="pagerEvents" /> </div> </template> </div> @@ -88,7 +94,7 @@ <script> import pageMixin from "@/components/makepager/pager/mixin/pageMixin" -import { getSalesLeadsList, getDeleteSalesLeads } from "@/api/client/salesLead" +import { getSupplierList, changeSupplierStatus } from "@/api/supplierManage/supplier" import DetailSupplier from "@/views/supplierManage/supplier/DetailSupplier" import AddSupplier from "@/views/supplierManage/supplier/AddSupplier" import RaleteSupplierList from "@/views/supplierManage/supplier/RaleteSupplierList" @@ -125,7 +131,11 @@ title: "娣诲姞", infomation: {} }, - search_map: {} + productPagerOptions: { + currPage: 1, + pageSize: 10, + totalCount: 0 + } } }, created() { @@ -141,11 +151,11 @@ tableColumn: [ { label: "渚涘簲鍟嗙紪鍙�", prop: "number", min: 190, isCommonClick: true }, { label: "渚涘簲鍟嗗悕绉�", prop: "name", min: 130 }, - { label: "渚涘簲鍟嗙被鍨�", prop: "contact_name", min: 130 }, - { label: "鎵�灞炶涓�", prop: "contact_phone", min: 130 }, - { label: "鑱旂郴浜�", prop: "sales_resources", min: 130 }, - { label: "鑱旂郴鐢佃瘽", prop: "province", min: 130 }, - { label: "鐘舵��", prop: "city", min: 130 }, + { label: "渚涘簲鍟嗙被鍨�", prop: "supplierType", min: 130 }, + { label: "鎵�灞炶涓�", prop: "industry", min: 130 }, + { label: "鑱旂郴浜�", prop: "contact", min: 130 }, + { label: "鑱旂郴鐢佃瘽", prop: "phone", min: 130 }, + { label: "鐘舵��", prop: "status_name", min: 130 }, { label: "鍒涘缓鏃堕棿", prop: "member_name", min: 130 } ] } @@ -183,49 +193,80 @@ } }, // 璇锋眰鏁版嵁 - async getData() { - await getSalesLeadsList({ - search_map: this.search_map, + async getData(val, content, searchName) { + if (searchName === "渚涘簲鍟�") { + this.getSupplierList(val, content) + } else if (searchName === "浜у搧") { + this.getProductList(val, content) + } else { + this.getSupplierList() + this.getProductList() + } + }, + // 渚涘簲鍟嗗垪琛� + async getSupplierList(val, content) { + await getSupplierList({ + [val]: content, page: this.pagerOptions.currPage, pageSize: this.pagerOptions.pageSize - }) - .then((res) => { - const list = res.data.list.map((item) => { + }).then((res) => { + console.log(res.data) + if (res.data.code === 200) { + const list = res.data.data.list.map((item) => { return { ...item, - province: item.Province.name, - city: item.City.name, - sales_resources: item.sales_sources.name, - member_name: item.member.username + status_name: item.status === 0 ? "鏈惎鐢�" : "鍚敤" } }) this.tableList.tableInfomation = list || [] - this.pagerOptions.totalCount = res.data.count - }) - .catch((err) => { - console.log(err) - }) + this.pagerOptions.totalCount = res.data.data.total + } + }) }, - // 鎼滅储 + // 浜у搧鍒楄〃 + async getProductList(val, content) { + console.log(val, content) + // await getProductList({ + // [val]: content, + // page: this.productPagerOptions.currPage, + // pageSize: this.productPagerOptions.pageSize + // }).then((res) => { + // console.log(res.data) + // }) + }, + // 鎼滅储渚涘簲鍟� searchClick(val, content) { console.log(val, content) - this.search_map = { - [val.value]: content - } - this.getData() + this.getData(val.value, content, "渚涘簲鍟�") }, resetClick() { - this.search_map = {} - this.getData() + this.getData("", "", "渚涘簲鍟�") + }, + // 鎼滅储浜у搧 + searchProductClick(val, content) { + console.log(val, content) + this.getData(val.value, content, "浜у搧") + }, + resetProductClick() { + this.getData("", "", "浜у搧") }, // 鏂板缓渚涘簲鍟� addBtnClick() { this.editConfig.visible = true this.editConfig.title = "鏂板缓" }, - // 缂栬緫渚涘簲鍟� - handleClick(row) { - console.log(row) + // 鍚敤渚涘簲鍟� + async enableClick(row, value) { + let status = value === "鍚敤" ? 1 : 0 + await changeSupplierStatus({ + id: row.ID, + status: status + }).then((res) => { + if (res.code === 200) { + this.$message.success("鐘舵�佷慨鏀规垚鍔�") + this.getData() + } + }) }, // 淇敼渚涘簲鍟� modifyClick(row) { @@ -261,14 +302,14 @@ }) .then(() => { console.log("dddd") - getDeleteSalesLeads({ ids: this.selValueList }).then((response) => { - if (response.code === 200) { - this.$message.success("鍒犻櫎鎴愬姛") - this.getData() - } else { - this.$message.warning("鍒犻櫎澶辫触") - } - }) + // deleteSupplier({ id: this.selValueList }).then((response) => { + // if (response.code === 200) { + // this.$message.success("鍒犻櫎鎴愬姛") + // this.getData() + // } else { + // this.$message.warning("鍒犻櫎澶辫触") + // } + // }) }) .catch(() => {}) } else { @@ -276,6 +317,7 @@ } }, getSelectArray(val) { + console.log(val) this.selValueList = [] const list = val.map((item) => { return item.id diff --git a/vue.config.js b/vue.config.js index 767e5e8..5436c86 100644 --- a/vue.config.js +++ b/vue.config.js @@ -14,7 +14,7 @@ devServer: { proxy: { "/api": { - target: "http://192.168.20.119:8002", // http://192.168.20.119:8002 http://fai365.com:30150/ + target: "http://192.168.20.118:8889", // http://192.168.20.119:8002 http://fai365.com:30150/ ws: true, changeOrigin: true } -- Gitblit v1.8.0