| | |
| | | <el-input |
| | | v-if=" |
| | | editConfig.title == '编辑' || |
| | | (editConfig.title == '新建' && |
| | | codenumer && |
| | | (explain != '' || isIdDisabled)) |
| | | (editConfig.title == '新建' && codenumer && (explain != '' || isIdDisabled)) |
| | | " |
| | | :disabled="editConfig.title == '编辑'" |
| | | v-model="editConfig.infomation.number" |
| | | placeholder="请输入编码" |
| | | > |
| | | </el-input> |
| | | <span v-else-if="editConfig.title == '新建'" style="color: #f56c6c" |
| | | <span v-else-if="editConfig.title == '新建'" style="color: #f56c6c" |
| | | >请优先配置编码规范 <el-button type="text" @click="numberClick"> 配置规范 </el-button></span |
| | | > |
| | | <!-- <WordInput |
| | |
| | | </div> |
| | | <div class="product-view"> |
| | | <CommonFormTableView |
| | | :show-summary="showSummary" |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | @emptyProductClick="emptyProductClick" |
| | | @recalculateProductClick="recalculateProductClick" |
| | | @clearupProduct="clearupProduct" |
| | | :show-summary="showSummary" |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | | @emptyProductClick="emptyProductClick" |
| | | @recalculateProductClick="recalculateProductClick" |
| | | @clearupProduct="clearupProduct" |
| | | /> |
| | | </div> |
| | | |
| | |
| | | import { getCityList } from "@/api/common/address" |
| | | import codeMixin from "@/components/makepager/mixin/codeMixin" |
| | | import { getContactList } from "@/api/client/contacts" |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView.vue"; |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView.vue" |
| | | export default { |
| | | name: "AddSalesOpportunityDialog", |
| | | mixins: [codeMixin], |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: {CommonFormTableView, SelectClientDialog, SelectContactDialog }, |
| | | components: { CommonFormTableView, SelectClientDialog, SelectContactDialog }, |
| | | computed: { |
| | | searchCommonHeight() { |
| | | return this.$refs.searchCommonView.offsetHeight |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur",'change'] }], |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], |
| | | name: [{ required: true, message: "请输入机会名称", trigger: "blur" }], |
| | | |
| | | member_id: [{ required: true, message: "请选择销售负责人", trigger: "change" }], |
| | | member_id: [{ required: true, validator: this.validateMemberId, trigger: "change" }], |
| | | sale_stage_id: [{ required: true, message: "请选择销售阶段", trigger: "change" }], |
| | | currency: [{ required: true, message: "请选择币种", trigger: "change" }], |
| | | expected_time: [{ required: true, message: "请选择预计成交日期", trigger: "change" }], |
| | |
| | | sumProp: ["Amount", "total"], |
| | | mergeNumber: 2 |
| | | }, |
| | | productId:1, |
| | | productId: 1 |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | if (val) { |
| | | this.formInfo() |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | methods: { |
| | | formInfo() { |
| | |
| | | getAllData() |
| | | .then((res) => { |
| | | this.memberOptions = res.data.member |
| | | if (this.editConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.member_id = item.id |
| | | } |
| | | }) |
| | | } |
| | | this.businessSourceOptions = res.data.sales_source |
| | | this.businessTypeOptions = res.data.sale_type |
| | | this.oldCustomerMarketOptions = res.data.regular_customers |
| | |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | const hasProduct = this.tableData.every(ele=>!!ele.name) |
| | | if (!hasProduct){ |
| | | const hasProduct = this.tableData.every((ele) => !!ele.name) |
| | | if (!hasProduct) { |
| | | this.$message.error("产品名称不能为空") |
| | | return |
| | | } |
| | |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("添加成功!") |
| | | this.$parent.getData() |
| | | // } |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg:"添加失败!") |
| | | if (this.editConfig.title === "新建" && this.editConfig.infomation?.sourceTitle === "推进") { |
| | | this.$parent.handleClose() |
| | | } else { |
| | | this.$parent.getData() |
| | | } |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg : "添加失败!") |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | this.$message.success("编辑成功!") |
| | | this.$parent.getData() |
| | | }else{ |
| | | this.$message.error(res.msg?res.msg:"编辑失败!") |
| | | this.$parent?.getData() |
| | | } else { |
| | | this.$message.error(res.msg ? res.msg : "编辑失败!") |
| | | } |
| | | }) |
| | | } |
| | |
| | | detail_address: data.detail_address || "", |
| | | |
| | | codeStandID: data.ID, |
| | | products: this.tableData, |
| | | products: this.tableData |
| | | } |
| | | return params |
| | | }, |
| | |
| | | clearupProduct(data) { |
| | | this.tableData = data |
| | | this.productTableList.tableData = this.tableData |
| | | }, |
| | | // 销售负责人自定义校验规则 |
| | | validateMemberId(rule, value, callback) { |
| | | if (this.editConfig.infomation?.member_id > 0) { |
| | | callback() |
| | | } else { |
| | | callback(new Error("请选择销售负责人")) |
| | | } |
| | | } |
| | | } |
| | | } |