| | |
| | | </template> |
| | | |
| | | <script> |
| | | // import { getAddContact, getUpdateContact } from "@/api/client/contacts" |
| | | // import { createProduct, updateProduct } from "@/api/productManage/product" |
| | | 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) => { |
| | | // createProduct(params).then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | |
| | | // } |
| | | // }) |
| | | } else { |
| | | // getUpdateContact(params).then((res) => { |
| | | // updateProduct(params).then((res) => { |
| | | // console.log(res) |
| | | // this.editConfig.visible = false |
| | | // if (res.code === 200) { |
| | |
| | | } |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | | // 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 || "", |
| | | email: data.email || "", |
| | | is_first: data.is_first || false, |
| | | member_id: data.member_id || 0, |
| | | 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 || "" |
| | | deliveryTime: 0, |
| | | id: 0, |
| | | maximumStock: 0, |
| | | minimumStock: 0, |
| | | name: "string", |
| | | number: "string", |
| | | productType: "string", |
| | | purchasePrice: 0, |
| | | remark: "string", |
| | | shippingDuration: 0, |
| | | specifications: "string", |
| | | supplierId: 0, |
| | | unit: "string" |
| | | } |
| | | return params |
| | | }, |
| | |
| | | tableColumn: [ |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true }, |
| | | { label: "产品编码", prop: "number" }, |
| | | { label: "计量单位", prop: "number" }, |
| | | { label: "规格型号", prop: "number" }, |
| | | { label: "采购价格", prop: "amount", inputFloat: true, isRequird: true }, |
| | | { label: "供货时长", prop: "price", inputNumber: true, isRequird: true }, |
| | | { label: "物流时长", prop: "total", inputNumber: true, isRequird: true } |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "规格型号", prop: "specifications" }, |
| | | { label: "采购价格", prop: "purchasePrice", inputFloat: true, isRequird: true }, |
| | | { label: "供货时长", prop: "deliveryTime", inputNumber: true, isRequird: true }, |
| | | { label: "物流时长", prop: "shippingDuration", inputNumber: true, isRequird: true } |
| | | ] |
| | | } |
| | | }, |