报价单 销售机会的必填和非必填从自动获取编码接口的header获取,对应的需要修改拦截器里方法
| | |
| | | import axios from "axios" |
| | | import request from "@/common/untils/request.js" |
| | | //编码规范列表 |
| | | // export function getCodeStandardList (data) { |
| | | // return request({ |
| | | // url: "/api/code/getCodeList", |
| | | // method: "post", |
| | | // data, |
| | | // }); |
| | | // } |
| | | export function getCodeStandardList(data) { |
| | | // return axios.get(`/api/code/getCodeList`, { |
| | | // params: data |
| | | // }) |
| | | |
| | | return request({ |
| | | url: "/api/code/getCodeList", |
| | | method: "get", |
| | |
| | | return request({ |
| | | url: "/api/code/getAutoCode", |
| | | method: "post", |
| | | IsHeader:true, |
| | | data |
| | | }) |
| | | } |
| | |
| | | (res) => { |
| | | /* //对响应数据做些事 */ |
| | | if (res.data.code === 200) { |
| | | if(res.config.IsHeader){ |
| | | return res; |
| | | }else{ |
| | | return res.data ? res.data : {} |
| | | } |
| | | } else if (res.data.code === 700001 || res.data.code === 700005) { |
| | | console.log("客户名称重复") |
| | | return res |
| | |
| | | " |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | | <span v-else> |
| | | <template v-if="pageName=='quotation'&&item.prop=='profit'"> |
| | | {{ (scope.row.price&&scope.row.cost)?Number(scope.row.price)-Number(scope.row.cost)+'':'' }} |
| | | </template> |
| | | <template v-if="pageName=='quotation'&&item.prop=='margin'"> |
| | | {{ (scope.row.price&&scope.row.cost)?((Number(scope.row.price)-Number(scope.row.cost))*100/Number(scope.row.cost)).toFixed(2)+'%':'' }} |
| | | </template> |
| | | <template v-else> |
| | | {{ scope.row[item.prop] }} |
| | | </template> |
| | | </span> |
| | | </template> |
| | | <el-form-item |
| | | v-else-if="item.inputNumber && selectBox" |
| | |
| | | ></el-input-number> |
| | | </el-form-item> |
| | | <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="40" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="deleteClick(scope)" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <slot name="tableButton" /> |
| | |
| | | selectBox: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | // 那个页面 用来判断计算方式 |
| | | pageName:{ |
| | | type:String, |
| | | default:'' |
| | | }, |
| | | productTableList: { |
| | | type: Object, |
| | |
| | | sums[index] = "小计:" |
| | | return |
| | | } |
| | | const title = ["#", "产品名称"] |
| | | const title = ["#", "产品名称",'产品编号','单位','销售单价','成本单价'] |
| | | // 去除某些不需要计算的数据 |
| | | if (title.includes(column.label)) { |
| | | sums[index] = "" |
| | | return |
| | | } |
| | | if(this.pageName=='quotation'&&column.label=='毛利'){ |
| | | sums[index] = "" |
| | | return |
| | | } |
| | |
| | | empty() { |
| | | this.isRecalculate = false |
| | | this.$emit("emptyProductClick") |
| | | }, |
| | | // 删除 |
| | | deleteClick(scope){ |
| | | this.tableList.tableData.splice(scope.$index,1) |
| | | this.$forceUpdate(); |
| | | this.$message.success('删除除成功!') |
| | | this.$emit("deleteClick",scope) |
| | | }, |
| | | // 重算 |
| | | recalculate() { |
| | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped> |
| | | .page-view { |
| | | |
| | | .el-form-item { |
| | | margin-bottom: 0; |
| | | .custom-name { |
| | |
| | | objCode: { name: "", page: 0, pageSize: 0, type: "跟进记录编码", codeStandID: "" }, |
| | | codeRule: {}, |
| | | codeLength: 0, |
| | | // header头的参数 |
| | | autoCodeHeadersObj:{ |
| | | xsjh:'', |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | async getAutoCodeValue() { |
| | | if(Object.keys(this.codeRule).length>0){ |
| | | const res = await getAutoCode(this.codeRule); |
| | | if (res.code == 200) { |
| | | this.$set(this.editConfig.infomation, 'number', res.data?res.data:'') |
| | | this.autoCodeHeadersObj=res.headers |
| | | if (res.data.code == 200) { |
| | | this.$set(this.editConfig.infomation, 'number', res.data.data?res.data.data:'') |
| | | }else{ |
| | | this.$set(this.editConfig.infomation, 'number', this.codeRule.AutoRule.PrefixValue?this.codeRule.AutoRule.PrefixValue:'') |
| | | } |
| | |
| | | const result = await hasPermission(to.path); |
| | | console.log(result,"result") |
| | | next(); |
| | | if (!isSkip) { |
| | | next('/noData') |
| | | } |
| | | // if (!isSkip) { |
| | | // next('/noData') |
| | | // } |
| | | } catch (error) { |
| | | console.error('Error in navigation guard:', error); |
| | | next(); |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售机会" prop="sale_chance_name"> |
| | | <el-form-item label="销售机会" prop="sale_chance_name" |
| | | :rules="[{ required: autoCodeHeadersObj.xsjh=='yes'?true:false, validator: this.checkChance, trigger: 'change' }]"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.sale_chance_name" |
| | |
| | | <div class="product-view"> |
| | | <CommonFormTableView |
| | | :show-summary="showSummary" |
| | | pageName="quotation" |
| | | :product-table-list="productTableList" |
| | | @inputContent="inputContent" |
| | | @addProductClick="addProductClick" |
| | |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], |
| | | quotationName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | quotation_status_id: [{ required: true, message: "请选择", trigger: "change" }], |
| | | sale_chance_name: [{ required: true, validator: this.checkChance, trigger: "change" }], |
| | | // sale_chance_name: [{ required: true, validator: this.checkChance, trigger: "change" }], |
| | | member_id: [{ required: true, validator: this.validateMemberId, trigger: "change" }] |
| | | }, |
| | | memberOptions: [], |
| | |
| | | show: true, |
| | | total: true, |
| | | sumProp: ["Amount", "total"], |
| | | mergeNumber: 2 |
| | | mergeNumber: 7 |
| | | }, |
| | | editSelectClientConfig: { |
| | | editVisible: false, |
| | |
| | | if (val) { |
| | | this.formInfo() |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | methods: { |
| | | formInfo() { |
| | |
| | | tableData: this.tableData, |
| | | tableColumn: [ |
| | | { label: "#", prop: "productId", width: 40 }, |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true }, |
| | | { label: "产品名称", prop: "name", productName: true, isRequird: true,min:110, }, |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | { label: "单位", prop: "unit" }, |
| | | { label: "销售单价", prop: "price", inputFloat: true }, |
| | | { label: "销售单价", prop: "price", inputFloat: true, isRequird: true }, |
| | | { label: "成本单价", prop: "cost",inputFloat: true }, |
| | | { label: "毛利", prop: "profit" }, |
| | | { label: "毛利率", prop: "margin",min:90}, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | { label: "价税合计", prop: "total", inputFloat: true } |
| | | ] |
| | | } |
| | |
| | | if (this.editConfig.infomation.sale_chance_name && this.editConfig.infomation.sale_chance_name.length > 0) { |
| | | callback() |
| | | } else { |
| | | if(this.autoCodeHeadersObj.xsjh=='yes'){ |
| | | callback(new Error("请选择销售机会")) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | }, |
| | | // 销售负责人自定义校验规则 |
| | |
| | | }, |
| | | // 编辑 |
| | | handleClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | console.log("dddddddd") |
| | | console.log(row) |
| | | this.editConfig.infomation = { ...row, currency: "人民币" } |
| | | let params = JSON.parse(JSON.stringify(row)); |
| | | this.editConfig.infomation = { ...params, currency: "人民币" } |
| | | console.log(this.editConfig.infomation.products,'===products') |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 批量删除 |
| | | delClick() { |
| | |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | 111: {{ autoCodeHeadersObj.Ywjh }} |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售机会" prop="sale_chance_name"> |
| | | <el-form-item label="销售机会" prop="sale_chance_name" |
| | | :rules="[{ required: autoCodeHeadersObj.Ywjh=='yes'?true:false, message: '请选择销售机会', trigger: 'change' }]"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | style="width: 100%" |
| | |
| | | </el-form-item> |
| | | </el-col> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="销售报价单" prop="quotation_number"> |
| | | <el-form-item label="销售报价单" prop="quotation_number" |
| | | :rules="[{ required: autoCodeHeadersObj.Bjd=='yes'?true:false, message: '请选择销售报价单', trigger: 'change' }]"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="editConfig.infomation.quotation_number" |
| | |
| | | number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], |
| | | signTime: [{ required: true, message: "请选择签约日期", trigger: "change" }], |
| | | memberId: [{ required: true, validator: this.validateMemberId, trigger: "change" }], |
| | | sale_chance_name: [{ required: true, message: "请选择销售机会", trigger: "change" }], |
| | | quotation_number: [{ required: true, message: "请选择销售报价单", trigger: "change" }], |
| | | // sale_chance_name: [{ required: true, message: "请选择销售机会", trigger: "change" }], |
| | | // quotation_number: [{ required: true, message: "请选择销售报价单", trigger: "change" }], |
| | | deliveryDate: [{ required: true, message: "请选择交付日期", trigger: "change" }] |
| | | // approvalOpinion: [{ required: true, message: "请输入", trigger: "blur" }] |
| | | }, |
| | |
| | | { label: "产品编号", prop: "number" }, |
| | | { label: "数量", prop: "amount", inputNumber: true, isRequird: true }, |
| | | { label: "单位", prop: "unit" }, |
| | | { label: "销售单价", prop: "price" }, |
| | | { label: "销售单价", prop: "price", isRequird: true }, |
| | | { label: "价税合计", prop: "total" } |
| | | ] |
| | | } |