| | |
| | | :disabled=" isView" |
| | | ></el-autocomplete> |
| | | <!-- !isAddQuatation && editConfig.infomation.sale_chance_name &&--> |
| | | <div |
| | | v-if=" !isView" |
| | | class="common-select-btn" |
| | | @click="selClientClick('quotation')" |
| | | > |
| | | <div v-if="!isView" class="common-select-btn" @click="selClientClick('quotation')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <!-- !isAddQuatation && --> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "50%", |
| | | dialogWidth: "60%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | client_name: [{ required: true, message: "请选择客户名称", trigger: "change" }], |
| | |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].name.length === 0) { |
| | | this.isNoProduct = true |
| | | break |
| | | } else { |
| | | this.isNoProduct = false |
| | | } |
| | | } |
| | | if (this.isNoProduct) { |
| | | this.$message.error("请选择产品") |
| | | } else { |
| | | // for (let i = 0; i < this.tableData.length; i++) { |
| | | // if (this.tableData[i].name.length === 0) { |
| | | // this.isNoProduct = true |
| | | // break |
| | | // } else { |
| | | // this.isNoProduct = false |
| | | // } |
| | | // } |
| | | // if (this.isNoProduct) { |
| | | // this.$message.error("请选择产品") |
| | | // } else { |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].cost) { |
| | | let reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/ |
| | |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | | return false |
| | | } |
| | | // } else { |
| | | // console.log("error submit") |
| | | // return false |
| | | // } |
| | | }) |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | | let products = [] |
| | | this.tableData.map((item) => { |
| | | if (item.number.length > 0) { |
| | | products.push(item) |
| | | } |
| | | }) |
| | | let commonParam = { |
| | | address: data.address || "", |
| | | addressee: data.addressee || "", |
| | |
| | | memberId: data.memberId || 0, |
| | | number: data.number || "", |
| | | phone: data.phone || "", |
| | | products: this.tableData, |
| | | products: products, |
| | | remark: data.remark || "", |
| | | saleChanceId: this.saleChanceId || 0, |
| | | saleType: data.saleType || 0, |
| | |
| | | if (res.code == 200) { |
| | | console.log(res) |
| | | this.quotationList = res.data.list |
| | | this.count=res.data.count; |
| | | this.count = res.data.count |
| | | if (value === "全部产品") { |
| | | // this.quotationList.map((item) => { |
| | | // if (item.id === this.editConfig.infomation.quotationId) { |
| | |
| | | this.editSelCommonConfig.tableInfomation = [...this.quotationList] |
| | | }else{ |
| | | // 反向选择 |
| | | this.editSelCommonConfig.isRequest = true; |
| | | this.editSelCommonConfig.isRequest = true |
| | | } |
| | | this.editSelCommonConfig.editVisible = true |
| | | } |
| | |
| | | selClient(row, value) { |
| | | if (value === "client") { |
| | | this.editConfig.infomation.sale_chance_name = "" |
| | | this.saleChanceId='' |
| | | this.saleChanceId = "" |
| | | this.editConfig.infomation.subbill_name = "" |
| | | // 清空报价单 |
| | | this.editConfig.infomation.quotation_number ='' |
| | | this.editConfig.infomation.quotation_number = "" |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.clientId = row.id |
| | | this.getSaleChanceList(row) |
| | |
| | | this.clientId = row.client.id |
| | | this.saleChanceId = row.id |
| | | // 清空报价单 |
| | | this.editConfig.infomation.quotation_number ='' |
| | | this.editConfig.infomation.quotation_number = "" |
| | | this.isAddQuatation = false |
| | | this.getQuotation(row.id) |
| | | } else if (value === "subbill") { |
| | |
| | | } |
| | | this.productTableList = { |
| | | tableData: this.tableData, |
| | | isReturn: true, |
| | | tableColumn: [ |
| | | { label: "#", prop: "productId", width: 40 }, |
| | | // { label: "#", prop: "productId", width: 40 }, |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true, min: 110 }, |
| | | { label: "规格", prop: "specs" }, |
| | | { label: "型号", prop: "type" }, |
| | |
| | | }, |
| | | // 产品列表输入 |
| | | inputContent(val, prop, row) { |
| | | this.productId = row.productId |
| | | // this.productId = row.productId |
| | | this.tableData.map((item) => { |
| | | if (item.productId === row.productId) { |
| | | if (item.number === row.number) { |
| | | item[prop] = val |
| | | } |
| | | }) |
| | |
| | | // this.showSummary.show = true |
| | | }, |
| | | // 新增方式修改 |
| | | getSelectArray(val) { |
| | | if (val.length > 0) { |
| | | val.map((item, index) => { |
| | | item.productId = this.tableData.length + index + 1 |
| | | }) |
| | | getSelectArray(val, index) { |
| | | if (this.tableData.length == 1 && this.tableData[0].number.length == 0) { |
| | | this.tableData = [] |
| | | } |
| | | if (index < this.tableData.length) { |
| | | this.tableData.splice(index, 1) |
| | | val.map((item, ind) => { |
| | | this.tableData.splice(index + ind, 0, item) |
| | | }) |
| | | } else { |
| | | this.tableData = this.tableData.concat(val) |
| | | } |
| | | this.productTableList.tableData = this.tableData |
| | | this.showSummary.show = true |
| | | }, |