17个文件已删除
2个文件已添加
10个文件已修改
| | |
| | | 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" |
New file |
| | |
| | | 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 |
| | | }) |
| | | } |
New file |
| | |
| | | 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 |
| | | }) |
| | | } |
| | | // 用id查询服务商 |
| | | 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 |
| | | }) |
| | | } |
| | | |
| | | // |
| | |
| | | /* //对响应数据做些事 */ |
| | | 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, |
| | |
| | | <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" |
| | |
| | | > |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table-column> --> |
| | | <el-table-column label="操作" width="110px"> |
| | | <template slot-scope="scope"> |
| | | <i |
| | |
| | | <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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getSupplierTypeList, updateSupplierType } from "@/api/supplierManage/supplier" |
| | | export default { |
| | | name: "EditDropdownDialog", |
| | | props: { |
| | |
| | | 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 |
| | | }, |
| | |
| | | // 新增下拉框 |
| | | 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() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | </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", |
| | |
| | | }, |
| | | 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: "销售负责人", prop: "member_name" }, // 销售负责人 |
| | | { label: "合计", prop: "tptal" } // 合计 |
| | | ] |
| | | } |
| | | this.searchSel = { value: "number", label: "订单编号" } |
| | | } else 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: "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: [ |
| | |
| | | // 请求数据 |
| | | 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() { |
| | |
| | | |
| | | <script> |
| | | let inputElement = null |
| | | import { getAddContact, getUpdateContact } from "@/api/client/contacts" |
| | | import EditDropdownDialog from "@/views/other/commonDialog/EditDropdownDialog" |
| | | export default { |
| | | name: "AddProductDialog", |
| | |
| | | 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") |
| | |
| | | </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"> |
| | |
| | | |
| | | <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" |
| | | |
| | |
| | | data() { |
| | | return { |
| | | tableList: {}, |
| | | selValueList: [], |
| | | searchOptions: [], |
| | | commonDetail: { |
| | | visible: false, |
| | |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | search_map: {} |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | { 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 } |
| | |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | 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() |
| | | }, |
| | | // 新建 |
| | |
| | | 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) { |
| | |
| | | </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", |
| | |
| | | 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() { |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | </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"> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售负责人" prop="sale_member"> |
| | | <el-input v-model="editConfig.infomation.sale_member" disabled></el-input> |
| | | <el-form-item label="销售负责人" 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"> |
| | |
| | | </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> |
| | |
| | | <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"> |
| | |
| | | </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> |
| | |
| | | </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: { |
| | |
| | | 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" }, |
| | |
| | | } |
| | | ] |
| | | }, |
| | | 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 |
| | | }, |
| | |
| | | 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() |
| | | } |
| | | }) |
| | |
| | | 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") |
| | |
| | | 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 |
| | | }, |
| | |
| | | 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、pdf格式!", |
| | | 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} 个文件`) |
| | | } |
| | | } |
| | | } |
| | |
| | | <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> |
| | |
| | | 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> |
| | |
| | | </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> |
| | |
| | | |
| | | <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" |
| | |
| | | title: "添加", |
| | | infomation: {} |
| | | }, |
| | | search_map: {} |
| | | productPagerOptions: { |
| | | currPage: 1, |
| | | pageSize: 10, |
| | | totalCount: 0 |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | 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 } |
| | | ] |
| | | } |
| | |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | 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) { |
| | |
| | | }) |
| | | .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 { |
| | |
| | | } |
| | | }, |
| | | getSelectArray(val) { |
| | | console.log(val) |
| | | this.selValueList = [] |
| | | const list = val.map((item) => { |
| | | return item.id |
| | |
| | | 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 |
| | | } |